diff --git a/DMCompiler/Optimizer/PeepholeOptimizer.cs b/DMCompiler/Optimizer/PeepholeOptimizer.cs index aad7cd7287..4da09e52fb 100644 --- a/DMCompiler/Optimizer/PeepholeOptimizer.cs +++ b/DMCompiler/Optimizer/PeepholeOptimizer.cs @@ -141,7 +141,7 @@ int AttemptCurrentOpt(int i) { var bytecode = input[i]; if (bytecode is not AnnotatedBytecodeInstruction instruction) { i -= AttemptCurrentOpt(i); - i = Math.Max(i, 0); + i = Math.Max(i, -1); // i++ brings -1 back to 0 continue; } @@ -160,7 +160,7 @@ int AttemptCurrentOpt(int i) { } i -= AttemptCurrentOpt(i); - i = Math.Max(i, 0); + i = Math.Max(i, -1); // i++ brings -1 back to 0 } AttemptCurrentOpt(input.Count);