Browse Source

Fix: OP_FORLOOP (close upvalues)

AnnulusGames 1 year ago
parent
commit
b0038fa8d7
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/Lua/Runtime/LuaVirtualMachine.cs

+ 1 - 0
src/Lua/Runtime/LuaVirtualMachine.cs

@@ -761,6 +761,7 @@ public static partial class LuaVirtualMachine
                     }
                     }
                 case OpCode.ForLoop:
                 case OpCode.ForLoop:
                     {
                     {
+                        state.CloseUpValues(thread, RA);
                         stack.EnsureCapacity(RA + 4);
                         stack.EnsureCapacity(RA + 4);
 
 
                         // TODO: add error message
                         // TODO: add error message