bug in lua_pushuserdata(L, NULL)

This commit is contained in:
Roberto Ierusalimschy
2001-02-01 11:56:49 -02:00
parent b68fb7f62e
commit 6858763994
3 changed files with 9 additions and 3 deletions

3
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 1.121 2001/01/26 11:45:51 roberto Exp roberto $
** $Id: lapi.c,v 1.122 2001/01/29 17:16:58 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -702,6 +702,7 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size) {
TString *ts;
void *p;
LUA_LOCK;
if (size == 0) size = 1;
ts = luaS_newudata(L, size, NULL);
setuvalue(L->top, ts);
api_incr_top(L);