Bug: Missing error status in panic function

'luaD_throw' may call 'luaE_resetthread', which returns an error code
but clears 'L->status'; so, 'luaD_throw' should set that status again.
This commit is contained in:
Roberto Ierusalimschy
2025-01-16 16:25:11 -03:00
parent 9f0c0fe0de
commit f5e55be2a0
3 changed files with 8 additions and 0 deletions

View File

@@ -399,6 +399,10 @@ do
-- trivial error
assert(T.checkpanic("pushstring hi; error") == "hi")
-- thread status inside panic (bug in 5.4.4)
assert(T.checkpanic("pushstring hi; error", "threadstatus; return 2") ==
"ERRRUN")
-- using the stack inside panic
assert(T.checkpanic("pushstring hi; error;",
[[checkstack 5 XX