From f19074f0ef184f9b8dc79ae8197a34ed5d5ca93c Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 6 Mar 1999 21:33:57 +0000 Subject: [PATCH] new rvaluetype, lvaluetype != rvaluetype for non ASSIGN_OP git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@306 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/expr/StoreInstruction.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/jode/jode/expr/StoreInstruction.java b/jode/jode/expr/StoreInstruction.java index 312fdd9..eaa9287 100644 --- a/jode/jode/expr/StoreInstruction.java +++ b/jode/jode/expr/StoreInstruction.java @@ -25,13 +25,20 @@ public abstract class StoreInstruction extends Operator public String lvCasts; Type lvalueType; + Type rvalueType; public StoreInstruction(Type type, int operator) { super(Type.tVoid, operator); lvalueType = type; + rvalueType = type; lvCasts = lvalueType.toString(); } + public void makeOpAssign(int operator) { + setOperatorIndex(operator); + rvalueType = Type.tUnknown; + } + public Type getType() { return type == Type.tVoid ? type : getLValueType(); } @@ -89,7 +96,7 @@ public abstract class StoreInstruction extends Operator public Type getOperandType(int i) { if (i == getLValueOperandCount()) - return getLValueType(); + return rvalueType; else return getLValueOperandType(i); } @@ -98,7 +105,10 @@ public abstract class StoreInstruction extends Operator int count = getLValueOperandCount(); if (count > 0) setLValueOperandType(t); - setLValueType(t[count]); + rvalueType = rvalueType.intersection(t[count]); + if (getOperatorIndex() == ASSIGN_OP) + /* In a direct assignment, lvalueType is rvalueType */ + setLValueType(rvalueType); } public int getOperandCount() {