diff --git a/jode/jode/expr/IIncOperator.java b/jode/jode/expr/IIncOperator.java index 33a21fe..17d4b86 100644 --- a/jode/jode/expr/IIncOperator.java +++ b/jode/jode/expr/IIncOperator.java @@ -57,6 +57,15 @@ implements LocalVarOperator { return 100; } + /** + * Makes a non void expression out of this store instruction. + */ + public void makeNonVoid() { + if (type != Type.tVoid) + throw new AssertError("already non void"); + type = local.getType(); + } + public boolean matches(Operator loadop) { return loadop instanceof LocalLoadOperator && ((LocalLoadOperator)loadop).getLocalInfo().getLocalInfo() @@ -69,7 +78,7 @@ implements LocalVarOperator { ? INC_OP : DEC_OP; return new LocalPrePostFixOperator - (local.getType(), op, this, true).simplify(); + (local.getType(), op, this, isVoid()).simplify(); } return super.simplify(); } diff --git a/jode/jode/expr/StoreInstruction.java b/jode/jode/expr/StoreInstruction.java index 6fa1111..8770451 100644 --- a/jode/jode/expr/StoreInstruction.java +++ b/jode/jode/expr/StoreInstruction.java @@ -34,6 +34,15 @@ public abstract class StoreInstruction extends Operator { return lvalueType; } + /** + * Makes a non void expression out of this store instruction. + */ + public void makeNonVoid() { + if (type != Type.tVoid) + throw new AssertError("already non void"); + type = lvalueType; + } + public abstract boolean matches(Operator loadop); public abstract int getLValueOperandCount(); public abstract int getLValueOperandPriority(int i);