Fix potential constant flag toggled off incorrectly while optimizing.

This commit is contained in:
2023-08-02 17:25:49 +08:00
parent 5393ff1451
commit 3b22d4fce3

View File

@@ -135,10 +135,7 @@ namespace Cryville.Common.Pdt {
for (var ins = il.First; ins != null; ins = ins.Next) { for (var ins = il.First; ins != null; ins = ins.Next) {
if (!(ins.Value is PdtInstruction.PushConstant)) { if (!(ins.Value is PdtInstruction.PushConstant)) {
exp.IsConstant = false; exp.IsConstant = false;
} break;
else if (!(ins.Value is PdtInstruction.PushVariable)) {
exp.IsPotentialConstant = false;
return;
} }
} }
} }