changeset 13715:b270b954ba9a

Avoid segfault in InstanceKlass::oop_print_on's String special case when the value array is null.
author Gilles Duboscq <duboscq@ssw.jku.at>
date Mon, 20 Jan 2014 19:49:47 +0100
parents cffcb8e38c4c
children 810f2c413ace
files src/share/vm/oops/instanceKlass.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/oops/instanceKlass.cpp	Mon Jan 20 19:48:53 2014 +0100
+++ b/src/share/vm/oops/instanceKlass.cpp	Mon Jan 20 19:49:47 2014 +0100
@@ -3016,9 +3016,9 @@
   if (this == SystemDictionary::String_klass()) {
     typeArrayOop value  = java_lang_String::value(obj);
     juint        offset = java_lang_String::offset(obj);
+    if (value != NULL) {
     juint        length = java_lang_String::length(obj);
-    if (value != NULL &&
-        value->is_typeArray() &&
+      if (value->is_typeArray() &&
         offset          <= (juint) value->length() &&
         offset + length <= (juint) value->length()) {
       st->print(BULLET"string: ");
@@ -3028,6 +3028,7 @@
       if (!WizardMode)  return;  // that is enough
     }
   }
+  }
 
   st->print_cr(BULLET"---- fields (total size %d words):", oop_size(obj));
   FieldPrinter print_field(st, obj);