differ between long and short constants

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@544 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 544e5ff99e
commit d70ef1d7d2
  1. 14
      jode/jode/obfuscator/FieldIdentifier.java

@ -154,16 +154,12 @@ public class FieldIdentifier extends Identifier{
nameIndex = gcp.putUTF(getAlias());
descriptorIndex = gcp.putUTF(clazz.bundle.getTypeAlias(getType()));
constvalIndex = 0;
AttributeInfo attribute = info.findAttribute("ConstantValue");
if (attribute != null) {
byte[] contents = attribute.getContents();
if (contents.length != 2)
throw new ClassFormatError("ConstantValue attribute"
+ " has wrong length");
int index = (contents[0] & 0xff) << 8 | (contents[1] & 0xff);
if (info.getConstant() != null) {
constvalIndex = gcp.putUTF("ConstantValue");
constvalcontentIndex =
gcp.copyConstant(clazz.info.getConstantPool(), index);
if (info.getType().stackSize() == 2)
constvalcontentIndex = gcp.putLongConstant(info.getConstant());
else
constvalcontentIndex = gcp.putConstant(info.getConstant());
}
}

Loading…
Cancel
Save