From f5e55be2a0ce64066c1b0554675633b92c91fafb Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 16 Jan 2025 16:25:11 -0300 Subject: 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. --- ldo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ldo.c') diff --git a/ldo.c b/ldo.c index ea052950..958b1b7d 100644 --- a/ldo.c +++ b/ldo.c @@ -120,6 +120,7 @@ l_noret luaD_throw (lua_State *L, int errcode) { else { /* thread has no error handler */ global_State *g = G(L); errcode = luaE_resetthread(L, errcode); /* close all upvalues */ + L->status = errcode; if (g->mainthread->errorJmp) { /* main thread has a handler? */ setobjs2s(L, g->mainthread->top.p++, L->top.p - 1); /* copy error obj. */ luaD_throw(g->mainthread, errcode); /* re-throw in main thread */ -- cgit v1.2.3-55-g6feb