Mercurial > hg > truffle
comparison src/share/vm/prims/jvmtiRedefineClasses.cpp @ 609:ea20d7ce26b0
6800721: 3/4 JavaThread::jvmti_thread_state() and JvmtiThreadState::state_for() robustness
Summary: Check for NULL return values from jvmti_thread_state() and state_for() and return a JVM TI error code as appropriate.
Reviewed-by: coleenp, swamyv
author | dcubed |
---|---|
date | Mon, 02 Mar 2009 14:00:23 -0700 |
parents | a61af66fc99e |
children | afa80fa86d22 |
comparison
equal
deleted
inserted
replaced
608:0386097d43d8 | 609:ea20d7ce26b0 |
---|---|
829 } | 829 } |
830 | 830 |
831 ResourceMark rm(THREAD); | 831 ResourceMark rm(THREAD); |
832 | 832 |
833 JvmtiThreadState *state = JvmtiThreadState::state_for(JavaThread::current()); | 833 JvmtiThreadState *state = JvmtiThreadState::state_for(JavaThread::current()); |
834 // state can only be NULL if the current thread is exiting which | |
835 // should not happen since we're trying to do a RedefineClasses | |
836 guarantee(state != NULL, "exiting thread calling load_new_class_versions"); | |
834 for (int i = 0; i < _class_count; i++) { | 837 for (int i = 0; i < _class_count; i++) { |
835 oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass); | 838 oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass); |
836 // classes for primitives cannot be redefined | 839 // classes for primitives cannot be redefined |
837 if (!is_modifiable_class(mirror)) { | 840 if (!is_modifiable_class(mirror)) { |
838 return JVMTI_ERROR_UNMODIFIABLE_CLASS; | 841 return JVMTI_ERROR_UNMODIFIABLE_CLASS; |