From 407e22750e3e51d463b1ff7f934b899ab71ce434 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 11 Mar 1999 22:52:45 +0000 Subject: [PATCH] set type of right hand side git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@372 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/CreateAssignExpression.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jode/jode/flow/CreateAssignExpression.java b/jode/jode/flow/CreateAssignExpression.java index bdbff0b..75551af 100644 --- a/jode/jode/flow/CreateAssignExpression.java +++ b/jode/jode/flow/CreateAssignExpression.java @@ -19,6 +19,7 @@ package jode.flow; import jode.expr.*; +import jode.Type; public class CreateAssignExpression { @@ -91,6 +92,7 @@ public class CreateAssignExpression { } int opIndex; Expression rightHandSide; + Type rhsType; if (expr.getOperator() instanceof ConvertOperator && expr.getSubExpressions()[0] instanceof ComplexExpression @@ -120,6 +122,7 @@ public class CreateAssignExpression { || !store.matches((Operator) loadExpr)) return false; rightHandSide = expr.getSubExpressions()[1]; + rhsType = binop.getOperandType(1); } else { /* For String += the situation is more complex. * what is marked as load(stack) * rightHandSide above is @@ -141,6 +144,8 @@ public class CreateAssignExpression { if (lastExpr == null || !(simple instanceof Operator) || !store.matches((Operator) simple)) return false; + + rhsType = lastExpr.getOperator().getOperandType(1); /* ... and remove it. */ if (lastExpr.getParent() != null) { @@ -158,7 +163,7 @@ public class CreateAssignExpression { dup.removeBlock(); ib.setInstruction(rightHandSide); - store.makeOpAssign(store.OPASSIGN_OP+opIndex); + store.makeOpAssign(store.OPASSIGN_OP+opIndex, rhsType); if (isAssignOp) store.makeNonVoid();