Ported a fix (this class could throw an ArrayIndexOutOfBoundsException due, to

missing checks if invoke has parameters) back to the 1.1 branch.
Bug reported by Rolf Howarth <rolf@squarebox.co.uk>.


git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1284 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 24 years ago
parent fb5d918702
commit 3506e82033
  1. 6
      jode/jode/flow/CreateClassField.java

@ -63,10 +63,12 @@ public class CreateClassField {
return false; return false;
InvokeOperator invoke = (InvokeOperator) store.getSubExpressions()[1]; InvokeOperator invoke = (InvokeOperator) store.getSubExpressions()[1];
if (!invoke.isGetClass())
return false;
Expression param = invoke.getSubExpressions()[0]; Expression param = invoke.getSubExpressions()[0];
if (invoke.isGetClass() if (param instanceof ConstOperator
&& param instanceof ConstOperator
&& ((ConstOperator)param).getValue() instanceof String) { && ((ConstOperator)param).getValue() instanceof String) {
String clazz = (String) ((ConstOperator)param).getValue(); String clazz = (String) ((ConstOperator)param).getValue();
if (put.getField().setClassConstant(clazz)) { if (put.getField().setClassConstant(clazz)) {

Loading…
Cancel
Save