Skip to content

Commit

Permalink
BCEL6: fix NPE in DismantleBytecode:716, see BCEL-273
Browse files Browse the repository at this point in the history
This is a partial fix for regressions running BCEL6 trunk code.

The tests are still failing due other issues, see
https://issues.apache.org/jira/browse/BCEL-273.
  • Loading branch information
iloveeclipse committed Jun 8, 2016
1 parent 5c37497 commit b6bcb26
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,12 @@ public void visit(Code obj) {
int s = ((ConstantString) constantRefOperand).getStringIndex();

stringConstantOperand = getStringFromIndex(s);
} else if (constantRefOperand instanceof ConstantInvokeDynamic) {
ConstantInvokeDynamic id = (ConstantInvokeDynamic) constantRefOperand;
ConstantNameAndType sig = (ConstantNameAndType) getConstantPool().getConstant(
id.getNameAndTypeIndex());
nameConstantOperand = getStringFromIndex(sig.getNameIndex());
sigConstantOperand = getStringFromIndex(sig.getSignatureIndex());
} else if (constantRefOperand instanceof ConstantCP) {
ConstantCP cp = (ConstantCP) constantRefOperand;
ConstantClass clazz = (ConstantClass) getConstantPool().getConstant(cp.getClassIndex());
Expand All @@ -721,14 +727,6 @@ public void visit(Code obj) {
nameConstantOperand = getStringFromIndex(sig.getNameIndex());
sigConstantOperand = getStringFromIndex(sig.getSignatureIndex());
refConstantOperand = null;
} else if (constantRefOperand instanceof ConstantInvokeDynamic) {
ConstantInvokeDynamic id = (ConstantInvokeDynamic) constantRefOperand;
ConstantNameAndType sig = (ConstantNameAndType) getConstantPool().getConstant(
id.getNameAndTypeIndex());
nameConstantOperand = getStringFromIndex(sig.getNameIndex());
sigConstantOperand = getStringFromIndex(sig.getSignatureIndex());


}
break;
case M_R:
Expand Down

0 comments on commit b6bcb26

Please sign in to comment.