6800721: 3/4 JavaThread::jvmti_thread_state() and JvmtiThreadState::state_for() robustness

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
This commit is contained in:
Daniel D. Daugherty 2009-03-02 14:00:23 -07:00
parent 74a99e1e82
commit 56fe18e375
7 changed files with 47 additions and 7 deletions

View file

@ -831,6 +831,9 @@ jvmtiError VM_RedefineClasses::load_new_class_versions(TRAPS) {
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