diff options
Diffstat (limited to 'libs/liblua/src/lauxlib.c')
-rw-r--r-- | libs/liblua/src/lauxlib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/liblua/src/lauxlib.c b/libs/liblua/src/lauxlib.c index e3d9be37f0..cbe9ed31c3 100644 --- a/libs/liblua/src/lauxlib.c +++ b/libs/liblua/src/lauxlib.c @@ -475,8 +475,10 @@ static void *resizebox (lua_State *L, int idx, size_t newsize) { lua_Alloc allocf = lua_getallocf(L, &ud); UBox *box = (UBox *)lua_touserdata(L, idx); void *temp = allocf(ud, box->box, box->bsize, newsize); - if (temp == NULL && newsize > 0) /* allocation error? */ - luaL_error(L, "not enough memory"); + if (temp == NULL && newsize > 0) { /* allocation error? */ + lua_pushliteral(L, "not enough memory"); + lua_error(L); /* raise a memory error */ + } box->box = temp; box->bsize = newsize; return temp; |