mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-12-19 00:29:29 +00:00
Fixed constant inlining inside constant value lists.
This commit is contained in:
parent
e314794f0b
commit
bd3c26b5ec
@ -107,6 +107,22 @@ public class VariableReplacer {
|
|||||||
}
|
}
|
||||||
return new ConstantBinary(aliasLeft, constantBinary.getOperator(), aliasRight);
|
return new ConstantBinary(aliasLeft, constantBinary.getOperator(), aliasRight);
|
||||||
}
|
}
|
||||||
|
} else if(rValue instanceof ConstantArray) {
|
||||||
|
ConstantArray constantArray = (ConstantArray) rValue;
|
||||||
|
ArrayList<ConstantValue> replacementList = new ArrayList<>();
|
||||||
|
boolean any = false;
|
||||||
|
for (ConstantValue elemValue : constantArray.getElements()) {
|
||||||
|
RValue elemReplacement = getReplacement(elemValue);
|
||||||
|
if(elemReplacement!=null) {
|
||||||
|
replacementList.add((ConstantValue) elemReplacement);
|
||||||
|
any = true;
|
||||||
|
} else{
|
||||||
|
replacementList.add(elemValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(any) {
|
||||||
|
return new ConstantArray(replacementList, constantArray.getElementType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No replacement found - return null
|
// No replacement found - return null
|
||||||
|
Loading…
Reference in New Issue
Block a user