aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ltests.c b/ltests.c
index 8470ab19..111c9f64 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 1.50 2000/10/06 19:29:26 roberto Exp roberto $ 2** $Id: ltests.c,v 1.51 2000/10/20 16:39:03 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -260,7 +260,10 @@ static int unref (lua_State *L) {
260} 260}
261 261
262static int newuserdata (lua_State *L) { 262static int newuserdata (lua_State *L) {
263 lua_pushusertag(L, (void *)luaL_check_int(L, 1), luaL_check_int(L, 2)); 263 if (lua_isnumber(L, 2))
264 lua_pushusertag(L, (void *)luaL_check_int(L, 1), luaL_check_int(L, 2));
265 else
266 lua_newuserdata(L, luaL_check_int(L, 1));
264 return 1; 267 return 1;
265} 268}
266 269