From: Mike Pall Date: Wed, 11 Feb 2026 22:16:59 +0000 (+0100) Subject: Fix G->jit_base relocation on stack resize. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=inline;p=thirdparty%2FLuaJIT.git Fix G->jit_base relocation on stack resize. Reported by f32y. #1435 --- diff --git a/src/lj_state.c b/src/lj_state.c index fc543c54..0c2c0750 100644 --- a/src/lj_state.c +++ b/src/lj_state.c @@ -72,7 +72,7 @@ static void resizestack(lua_State *L, MSize n) while (oldsize < realsize) /* Clear new slots. */ setnilV(st + oldsize++); L->stacksize = realsize; - if ((size_t)(mref(G(L)->jit_base, char) - (char *)oldst) < oldsize) + if ((size_t)(mref(G(L)->jit_base, char) - (char *)oldst) < (size_t)oldsize * sizeof(TValue)) setmref(G(L)->jit_base, mref(G(L)->jit_base, char) + delta); L->base = (TValue *)((char *)L->base + delta); L->top = (TValue *)((char *)L->top + delta);