* jode/flow/CreateAssignExpression.java (createAssignOp):

Bug fix: Check whether store is already a op-assign and break out.
* jode/expr/StoreInstruction.java (isOpAssign): New function to
check whether this is an op-assign.


git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1357 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 23 years ago
parent 910456c0b0
commit a0caad2c2c
  1. 7
      jode/ChangeLog
  2. 10
      jode/jode/expr/StoreInstruction.java
  3. 2
      jode/jode/flow/CreateAssignExpression.java

@ -1,3 +1,10 @@
2002-02-01 Jochen Hoenicke <jochen@gnu.org>
* jode/flow/CreateAssignExpression.java (createAssignOp):
Bug fix: Check whether store is already a op-assign and break out.
* jode/expr/StoreInstruction.java (isOpAssign): New function to
check whether this is an op-assign.
2002-01-16 Jochen Hoenicke <jochen@gnu.org> 2002-01-16 Jochen Hoenicke <jochen@gnu.org>
Fixes by anonymous for SerializePreserver: Fixes by anonymous for SerializePreserver:

@ -25,7 +25,7 @@ import jode.decompiler.TabbedPrintWriter;
public class StoreInstruction extends Operator public class StoreInstruction extends Operator
implements CombineableOperator { implements CombineableOperator {
boolean isOpAssign = false; boolean opAssign = false;
public StoreInstruction(LValueExpression lvalue) { public StoreInstruction(LValueExpression lvalue) {
super(Type.tVoid, ASSIGN_OP); super(Type.tVoid, ASSIGN_OP);
@ -41,7 +41,11 @@ public class StoreInstruction extends Operator
setOperatorIndex(operatorIndex); setOperatorIndex(operatorIndex);
if (subExpressions[1] instanceof NopOperator) if (subExpressions[1] instanceof NopOperator)
subExpressions[1].type = Type.tUnknown; subExpressions[1].type = Type.tUnknown;
isOpAssign = true; opAssign = true;
}
public boolean isOpAssign() {
return opAssign;
} }
/** /**
@ -72,7 +76,7 @@ public class StoreInstruction extends Operator
Type newType; Type newType;
if (!isOpAssign) { if (!opAssign) {
/* An opassign (+=, -=, etc.) doesn't merge rvalue type. */ /* An opassign (+=, -=, etc.) doesn't merge rvalue type. */
Type lvalueType = subExpressions[0].getType(); Type lvalueType = subExpressions[0].getType();
Type rvalueType = subExpressions[1].getType(); Type rvalueType = subExpressions[1].getType();

@ -56,7 +56,7 @@ public class CreateAssignExpression {
SequentialBlock opBlock = (SequentialBlock) last.outer; SequentialBlock opBlock = (SequentialBlock) last.outer;
StoreInstruction store = (StoreInstruction) ic.getInstruction(); StoreInstruction store = (StoreInstruction) ic.getInstruction();
if (!store.isFreeOperator()) if (!store.isFreeOperator() || store.isOpAssign())
return false; return false;
Expression lvalue = store.getSubExpressions()[0]; Expression lvalue = store.getSubExpressions()[0];
int lvalueCount = lvalue.getFreeOperandCount(); int lvalueCount = lvalue.getFreeOperandCount();

Loading…
Cancel
Save