comparison src/share/vm/opto/parse2.cpp @ 8862:e370f63dc5b1

8009539: JVM crash when run lambda testng tests Summary: Ensure class pointer is non-null before dereferencing it to check if it is loaded. Reviewed-by: kvn
author bharadwaj
date Fri, 22 Mar 2013 07:58:55 -0700
parents beebba0acc11
children 6f3fd5150b67
comparison
equal deleted inserted replaced
8782:c3c64a973559 8862:e370f63dc5b1
102 if (idxtype->_hi < sizetype->_lo && idxtype->_lo >= 0) { 102 if (idxtype->_hi < sizetype->_lo && idxtype->_lo >= 0) {
103 need_range_check = false; 103 need_range_check = false;
104 if (C->log() != NULL) C->log()->elem("observe that='!need_range_check'"); 104 if (C->log() != NULL) C->log()->elem("observe that='!need_range_check'");
105 } 105 }
106 106
107 if (!arytype->klass()->is_loaded()) { 107 ciKlass * arytype_klass = arytype->klass();
108 if ((arytype_klass != NULL) && (!arytype_klass->is_loaded())) {
108 // Only fails for some -Xcomp runs 109 // Only fails for some -Xcomp runs
109 // The class is unloaded. We have to run this bytecode in the interpreter. 110 // The class is unloaded. We have to run this bytecode in the interpreter.
110 uncommon_trap(Deoptimization::Reason_unloaded, 111 uncommon_trap(Deoptimization::Reason_unloaded,
111 Deoptimization::Action_reinterpret, 112 Deoptimization::Action_reinterpret,
112 arytype->klass(), "!loaded array"); 113 arytype->klass(), "!loaded array");
1383 #ifdef ASSERT 1384 #ifdef ASSERT
1384 // for setting breakpoints 1385 // for setting breakpoints
1385 if (TraceOptoParse) { 1386 if (TraceOptoParse) {
1386 tty->print(" @"); 1387 tty->print(" @");
1387 dump_bci(bci()); 1388 dump_bci(bci());
1389 tty->cr();
1388 } 1390 }
1389 #endif 1391 #endif
1390 1392
1391 switch (bc()) { 1393 switch (bc()) {
1392 case Bytecodes::_nop: 1394 case Bytecodes::_nop: