diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -254,6 +254,13 @@ static int hash_query (lua_State *L) { | |||
254 | } | 254 | } |
255 | 255 | ||
256 | 256 | ||
257 | static int Cstacklevel (lua_State *L) { | ||
258 | unsigned long a = 0; | ||
259 | lua_pushnumber(L, (unsigned long)&a); | ||
260 | return 1; | ||
261 | } | ||
262 | |||
263 | |||
257 | static int table_query (lua_State *L) { | 264 | static int table_query (lua_State *L) { |
258 | const Table *t; | 265 | const Table *t; |
259 | int i = luaL_opt_int(L, 2, -1); | 266 | int i = luaL_opt_int(L, 2, -1); |
@@ -368,7 +375,6 @@ static int udataval (lua_State *L) { | |||
368 | static int doonnewstack (lua_State *L) { | 375 | static int doonnewstack (lua_State *L) { |
369 | lua_State *L1 = lua_newthread(L, luaL_check_int(L, 1)); | 376 | lua_State *L1 = lua_newthread(L, luaL_check_int(L, 1)); |
370 | if (L1 == NULL) return 0; | 377 | if (L1 == NULL) return 0; |
371 | *cast(int **, L1) = &islocked; /* initialize the lock */ | ||
372 | lua_dostring(L1, luaL_check_string(L, 2)); | 378 | lua_dostring(L1, luaL_check_string(L, 2)); |
373 | lua_pushnumber(L, 1); | 379 | lua_pushnumber(L, 1); |
374 | lua_close(L1); | 380 | lua_close(L1); |
@@ -624,6 +630,7 @@ static const struct luaL_reg tests_funcs[] = { | |||
624 | {"listk", listk}, | 630 | {"listk", listk}, |
625 | {"listlocals", listlocals}, | 631 | {"listlocals", listlocals}, |
626 | {"loadlib", loadlib}, | 632 | {"loadlib", loadlib}, |
633 | {"Cstacklevel", Cstacklevel}, | ||
627 | {"querystr", string_query}, | 634 | {"querystr", string_query}, |
628 | {"querytab", table_query}, | 635 | {"querytab", table_query}, |
629 | {"testC", testC}, | 636 | {"testC", testC}, |