diff src/share/vm/opto/memnode.cpp @ 1766:02f0a9b6f654

6969586: OptimizeStringConcat: SIGSEGV in LoadNode::Value() Reviewed-by: kvn
author never
date Mon, 30 Aug 2010 17:27:35 -0700
parents 4311f23817fd
children 5867d89c129b
line wrap: on
line diff
--- a/src/share/vm/opto/memnode.cpp	Mon Aug 30 11:02:53 2010 -0700
+++ b/src/share/vm/opto/memnode.cpp	Mon Aug 30 17:27:35 2010 -0700
@@ -1547,8 +1547,8 @@
         adr->is_AddP() && off != Type::OffsetBot) {
       // For constant Strings treat the fields as compile time constants.
       Node* base = adr->in(AddPNode::Base);
-      if (base->Opcode() == Op_ConP) {
-        const TypeOopPtr* t = phase->type(base)->isa_oopptr();
+      const TypeOopPtr* t = phase->type(base)->isa_oopptr();
+      if (t != NULL && t->singleton()) {
         ciObject* string = t->const_oop();
         ciConstant constant = string->as_instance()->field_value_by_offset(off);
         if (constant.basic_type() == T_INT) {