Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Lua/Runtime/LuaVirtualMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -932,16 +932,17 @@ static bool MoveNext(ref VirtualMachineExecutionContext context, out PostOperati
}
catch (Exception e)
{
context.PopOnTopCallStackFrames();
context.State.CloseUpValues(context.Thread, context.FrameBase);
LuaValueArrayPool.Return1024(context.ResultsBuffer, true);
if (e is not LuaRuntimeException)
{
var newException = new LuaRuntimeException(GetTracebacks(ref context), e);
var newException = new LuaRuntimeException(context.State.GetTraceback(), e);
context.PopOnTopCallStackFrames();
Copy link

@CodeSmile-0000011110110111 CodeSmile-0000011110110111 Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context is default, calling a method on it will throw a nullref
maybe you wanted to pop first, then assign default? That seems to work for me but no idea if that's correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you seen this commit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context = default;
throw newException;
}

context.PopOnTopCallStackFrames();
throw;
}
}
Expand Down