From de3ed511b19913f24fda98a87766f4189dd8db74 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Thu, 26 Jan 2012 09:38:28 +0100 Subject: [PATCH] 7123910: Some CTW tests crash VM: is_loaded() && that->is_loaded() Handle not loaded array klass in Parse::do_checkcast(). Reviewed-by: kvn, never --- hotspot/src/share/vm/opto/parseHelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/opto/parseHelper.cpp b/hotspot/src/share/vm/opto/parseHelper.cpp index 9ebc716b548..26a146f5e88 100644 --- a/hotspot/src/share/vm/opto/parseHelper.cpp +++ b/hotspot/src/share/vm/opto/parseHelper.cpp @@ -71,14 +71,14 @@ void Parse::do_checkcast() { // Throw uncommon trap if class is not loaded or the value we are casting // _from_ is not loaded, and value is not null. If the value _is_ NULL, // then the checkcast does nothing. - const TypeInstPtr *tp = _gvn.type(obj)->isa_instptr(); - if (!will_link || (tp && !tp->is_loaded())) { + const TypeOopPtr *tp = _gvn.type(obj)->isa_oopptr(); + if (!will_link || (tp && tp->klass() && !tp->klass()->is_loaded())) { if (C->log() != NULL) { if (!will_link) { C->log()->elem("assert_null reason='checkcast' klass='%d'", C->log()->identify(klass)); } - if (tp && !tp->is_loaded()) { + if (tp && tp->klass() && !tp->klass()->is_loaded()) { // %%% Cannot happen? C->log()->elem("assert_null reason='checkcast source' klass='%d'", C->log()->identify(tp->klass()));