Browse Source

fix: meta SetTab

Akeit0 7 months ago
parent
commit
27ccf7b033
2 changed files with 5 additions and 0 deletions
  1. 4 0
      src/Lua/Runtime/LuaStack.cs
  2. 1 0
      src/Lua/Runtime/LuaVirtualMachine.cs

+ 4 - 0
src/Lua/Runtime/LuaStack.cs

@@ -1,6 +1,7 @@
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using Lua.Internal;
+using System.Diagnostics;
 
 namespace Lua.Runtime;
 
@@ -139,6 +140,9 @@ public sealed class LuaStack(int initialSize = 256)
     {
         throw new InvalidOperationException("Empty stack");
     }
+    
+    [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
+    private  Span<LuaValue> Span => AsSpan();
 
     internal void SetTop(int top)
     {

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

@@ -163,6 +163,7 @@ public static partial class LuaVirtualMachine
                     Thread.PopCallStackFrameWithStackPop(target + 2);
                     return true;
                 case OpCode.SetTable or OpCode.SetTabUp:
+                    target = frame.Base;
                     targetCount = 0;
                     break;
                 // Other opcodes has one result