rvalueType reworked, didn't work since setLValueType is overloaded

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@326 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 45b0e6a131
commit 3094724277
  1. 18
      jode/jode/expr/StoreInstruction.java

@ -30,13 +30,12 @@ public abstract class StoreInstruction extends Operator
public StoreInstruction(Type type, int operator) {
super(Type.tVoid, operator);
lvalueType = type;
rvalueType = type;
rvalueType = Type.tUnknown;
lvCasts = lvalueType.toString();
}
public void makeOpAssign(int operator) {
setOperatorIndex(operator);
rvalueType = Type.tUnknown;
}
public Type getType() {
@ -95,9 +94,13 @@ public abstract class StoreInstruction extends Operator
}
public Type getOperandType(int i) {
if (i == getLValueOperandCount())
return rvalueType;
else
if (i == getLValueOperandCount()) {
if (getOperatorIndex() == ASSIGN_OP)
/* In a direct assignment, lvalueType is rvalueType */
return getLValueType();
else
return rvalueType;
} else
return getLValueOperandType(i);
}
@ -105,10 +108,11 @@ public abstract class StoreInstruction extends Operator
int count = getLValueOperandCount();
if (count > 0)
setLValueOperandType(t);
rvalueType = rvalueType.intersection(t[count]);
if (getOperatorIndex() == ASSIGN_OP)
/* In a direct assignment, lvalueType is rvalueType */
setLValueType(rvalueType);
setLValueType(t[count]);
else
rvalueType = rvalueType.intersection(t[count]);
}
public int getOperandCount() {

Loading…
Cancel
Save