diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-08-06 12:32:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-08-06 12:32:22 -0300 |
commit | a2fa48a570b01b2a2cd37f01799f08f693fc5892 (patch) | |
tree | b41fc7e88f7f941ae1589921f8d7c0ff57146f4d /ltests.c | |
parent | 8b2b8790b5c419282f4fa0c7faa168379647b3b9 (diff) | |
download | lua-a2fa48a570b01b2a2cd37f01799f08f693fc5892.tar.gz lua-a2fa48a570b01b2a2cd37f01799f08f693fc5892.tar.bz2 lua-a2fa48a570b01b2a2cd37f01799f08f693fc5892.zip |
new (old?) error handling scheme
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.130 2002/07/17 16:25:13 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.131 2002/08/05 14:10:10 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 | */ |
@@ -402,7 +402,7 @@ static int doonnewstack (lua_State *L) { | |||
402 | const char *s = luaL_check_lstr(L, 1, &l); | 402 | const char *s = luaL_check_lstr(L, 1, &l); |
403 | int status = luaL_loadbuffer(L1, s, l, s); | 403 | int status = luaL_loadbuffer(L1, s, l, s); |
404 | if (status == 0) | 404 | if (status == 0) |
405 | status = lua_pcall(L1, 0, 0); | 405 | status = lua_pcall(L1, 0, 0, 0); |
406 | lua_pushnumber(L, status); | 406 | lua_pushnumber(L, status); |
407 | lua_closethread(L, L1); | 407 | lua_closethread(L, L1); |
408 | return 1; | 408 | return 1; |
@@ -456,10 +456,8 @@ static int doremote (lua_State *L) { | |||
456 | int status; | 456 | int status; |
457 | lua_settop(L1, 0); | 457 | lua_settop(L1, 0); |
458 | status = luaL_loadbuffer(L1, code, lcode, code); | 458 | status = luaL_loadbuffer(L1, code, lcode, code); |
459 | if (status == 0) { | 459 | if (status == 0) |
460 | status = lua_pcall(L1, 0, LUA_MULTRET); | 460 | status = lua_pcall(L1, 0, LUA_MULTRET, 0); |
461 | if (status != 0) lua_pcallreset(L1); | ||
462 | } | ||
463 | if (status != 0) { | 461 | if (status != 0) { |
464 | lua_pushnil(L); | 462 | lua_pushnil(L); |
465 | lua_pushnumber(L, status); | 463 | lua_pushnumber(L, status); |
@@ -647,7 +645,7 @@ static int testC (lua_State *L) { | |||
647 | else if EQ("call") { | 645 | else if EQ("call") { |
648 | int narg = getnum; | 646 | int narg = getnum; |
649 | int nres = getnum; | 647 | int nres = getnum; |
650 | lua_pcall(L, narg, nres); | 648 | lua_pcall(L, narg, nres, 0); |
651 | } | 649 | } |
652 | else if EQ("loadstring") { | 650 | else if EQ("loadstring") { |
653 | size_t sl; | 651 | size_t sl; |