Browse Source

Fix: SetList misplaces the top of the stack

Akeit0 10 months ago
parent
commit
db1e46eb8d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/Lua/Runtime/LuaVirtualMachine.cs

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

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