Browse Source

Fix: compiler (while)

AnnulusGames 1 year ago
parent
commit
7b84517f88
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Lua/CodeAnalysis/Compilation/LuaCompiler.cs

+ 1 - 1
src/Lua/CodeAnalysis/Compilation/LuaCompiler.cs

@@ -830,7 +830,7 @@ public sealed class LuaCompiler : ISyntaxNodeVisitor<ScopeCompilationContext, bo
         // set JMP sBx
         // set JMP sBx
         context.Function.Instructions[conditionIndex].SBx = context.Function.Instructions.Length - 1 - conditionIndex;
         context.Function.Instructions[conditionIndex].SBx = context.Function.Instructions.Length - 1 - conditionIndex;
 
 
-        CompileConditionNode(node.ConditionNode, context, false);
+        CompileConditionNode(node.ConditionNode, context, true);
         var a = scopeContext.HasCapturedLocalVariables ? scopeContext.StackTopPosition : (byte)0;
         var a = scopeContext.HasCapturedLocalVariables ? scopeContext.StackTopPosition : (byte)0;
         context.PushInstruction(Instruction.Jmp(a, conditionIndex - context.Function.Instructions.Length), node.Position);
         context.PushInstruction(Instruction.Jmp(a, conditionIndex - context.Function.Instructions.Length), node.Position);