Mercurial > hg > truffle
diff 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 |
line wrap: on
line diff
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon Mar 02 13:57:17 2009 -0700 +++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon Mar 02 14:00:23 2009 -0700 @@ -831,6 +831,9 @@ ResourceMark rm(THREAD); JvmtiThreadState *state = JvmtiThreadState::state_for(JavaThread::current()); + // state can only be NULL if the current thread is exiting which + // should not happen since we're trying to do a RedefineClasses + guarantee(state != NULL, "exiting thread calling load_new_class_versions"); for (int i = 0; i < _class_count; i++) { oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass); // classes for primitives cannot be redefined