]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix frame for on-trace out-of-memory error.
authorMike Pall <mike>
Fri, 2 Jun 2023 09:42:58 +0000 (11:42 +0200)
committerMike Pall <mike>
Fri, 2 Jun 2023 09:42:58 +0000 (11:42 +0200)
Reported by ruidong007.

src/lj_err.c

index a497ab113ac82c023aa107450c6108aec134915d..3ee70b86424cb08d255482f72414704e38bcd3f9 100644 (file)
@@ -777,6 +777,10 @@ LJ_NOINLINE void lj_err_mem(lua_State *L)
 {
   if (L->status == LUA_ERRERR+1)  /* Don't touch the stack during lua_open. */
     lj_vm_unwind_c(L->cframe, LUA_ERRMEM);
+  if (LJ_HASJIT) {
+    TValue *base = tvref(G(L)->jit_base);
+    if (base) L->base = base;
+  }
   if (curr_funcisL(L)) L->top = curr_topL(L);
   setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRMEM));
   lj_err_throw(L, LUA_ERRMEM);