{
if (L->status == LUA_ERRERR+1) /* Don't touch the stack during lua_open. */
lj_vm_unwind_c(L->cframe, LUA_ERRMEM);
+ L->top = L->base;
setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRMEM));
lj_err_throw(L, LUA_ERRMEM);
}
lua_assert((osz == 0) == (p == NULL));
p = g->allocf(g->allocd, p, osz, nsz);
if (p == NULL && nsz > 0)
- lj_err_throw(L, LUA_ERRMEM);
+ lj_err_mem(L);
lua_assert((nsz == 0) == (p == NULL));
lua_assert(checkptr32(p));
g->gc.total = (g->gc.total - osz) + nsz;
global_State *g = G(L);
GCobj *o = (GCobj *)g->allocf(g->allocd, NULL, 0, size);
if (o == NULL)
- lj_err_throw(L, LUA_ERRMEM);
+ lj_err_mem(L);
lua_assert(checkptr32(o));
g->gc.total += size;
setgcrefr(o->gch.nextgc, g->gc.root);