Browse Source

Merge pull request #102 from Akeit0/fix-setlist-stacktop

Fix: SetList misplaces the top of the stack
Akeit0 8 months ago
parent
commit
f35ee2b2a3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/Lua/Runtime/LuaVirtualMachine.cs

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

@@ -1265,6 +1265,7 @@ public static partial class LuaVirtualMachine
         table.EnsureArrayCapacity((instruction.C - 1) * 50 + count);
         stack.GetBuffer().Slice(RA + 1, count)
             .CopyTo(table.GetArraySpan()[((instruction.C - 1) * 50)..]);
+        stack.PopUntil(RA + 1);
     }
 
     static void ComparePostOperation(ref VirtualMachineExecutionContext context)