changeset 5166:6b3ac96bada6

8023477: Invalid CP index when reading ConstantPool. Summary: Need to check for 0 case for InstanceKlass::_generic_signature_index. Reviewed-by: sspitsyn, sla
author jiangli
date Mon, 26 Aug 2013 13:32:14 -0400
parents faf2631b9334
children b3596321fbf4
files agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Mon Aug 26 09:33:01 2013 +0200
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Mon Aug 26 13:32:14 2013 -0400
@@ -354,9 +354,16 @@
   public boolean   getIsMarkedDependent()   { return                isMarkedDependent.getValue(this) != 0; }
   public long      getVtableLen()           { return                vtableLen.getValue(this); }
   public long      getItableLen()           { return                itableLen.getValue(this); }
-  public Symbol    getGenericSignature()    { return                getConstants().getSymbolAt(genericSignatureIndex.getValue(this)); }
   public long      majorVersion()           { return                majorVersion.getValue(this); }
   public long      minorVersion()           { return                minorVersion.getValue(this); }
+  public Symbol    getGenericSignature()    {
+    long index = genericSignatureIndex.getValue(this);
+    if (index != 0) {
+      return getConstants().getSymbolAt(index);
+    } else {
+      return null;
+    }
+  }
 
   // "size helper" == instance size in words
   public long getSizeHelper() {