8023477: Invalid CP index when reading ConstantPool

Need to check for 0 case for InstanceKlass::_generic_signature_index.

Reviewed-by: sspitsyn, sla
This commit is contained in:
Jiangli Zhou 2013-08-26 13:32:14 -04:00
parent 618cb11a73
commit 033640bd2c

View File

@ -354,9 +354,16 @@ public class InstanceKlass extends Klass {
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() {