mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-24 01:46:07 +00:00
Fixed: #2354 Simplify expressions problems in some cases
This commit is contained in:
@@ -709,10 +709,10 @@ public abstract class InstructionDefinition implements Serializable {
|
||||
}
|
||||
if (getProperty.object instanceof SetLocalAVM2Item) {
|
||||
SetLocalAVM2Item objSetLocalReg = (SetLocalAVM2Item) getProperty.object;
|
||||
|
||||
|
||||
if ((valueLocalReg.regIndex == valueSetLocalReg.regIndex)
|
||||
&& (propertyName.multinameIndex == multinameIndex)
|
||||
&& ((nameLocalReg == null && nameSetLocalReg == null) || (nameLocalReg.regIndex == nameSetLocalReg.regIndex))
|
||||
&& ((nameLocalReg == null && nameSetLocalReg == null) || (nameLocalReg != null && nameSetLocalReg != null && nameLocalReg.regIndex == nameSetLocalReg.regIndex))
|
||||
&& (objLocalReg.regIndex == objSetLocalReg.regIndex)) {
|
||||
if (nameSetLocalReg != null) {
|
||||
propertyName.name = nameSetLocalReg.value;
|
||||
|
||||
@@ -92,8 +92,14 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp {
|
||||
@Override
|
||||
public GraphTargetItem simplify(String implicitCoerce) {
|
||||
BinaryOpItem r = (BinaryOpItem) clone();
|
||||
r.leftSide = r.leftSide.simplify(coerceLeft);
|
||||
r.leftSide = r.leftSide.simplify(coerceLeft);
|
||||
r.rightSide = r.rightSide.simplify(coerceRight);
|
||||
|
||||
if (r.leftSide == this.leftSide
|
||||
&& r.rightSide == this.rightSide) {
|
||||
r = this;
|
||||
}
|
||||
|
||||
return simplifySomething(r, implicitCoerce);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp {
|
||||
public GraphTargetItem simplify(String implicitCoerce) {
|
||||
GraphTargetItem r = clone();
|
||||
r.value = r.value.simplify(coerce);
|
||||
if (r.value == this.value) {
|
||||
r = this;
|
||||
}
|
||||
return simplifySomething(r, implicitCoerce);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user