Browse Source

fix: off tailcall flag on error

Akeit0 7 months ago
parent
commit
41734dda01
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Lua/Runtime/LuaVirtualMachine.cs

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

@@ -2392,7 +2392,7 @@ public static partial class LuaVirtualMachine
     static void GetThreadWithCurrentPc(LuaThread thread, int pc)
     {
         var frame = thread.GetCurrentFrame();
-        thread.PushCallStackFrame(frame with { CallerInstructionIndex = pc });
+        thread.PushCallStackFrame(frame with { CallerInstructionIndex = pc,Flags = frame.Flags^ CallStackFrameFlags.TailCall });
     }
 
     [MethodImpl(MethodImplOptions.AggressiveInlining)]