diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/lbaselib.c | 5 | ||||
-rw-r--r-- | src/lvm.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/lbaselib.c b/src/lib/lbaselib.c index 45bc7cfe..b6a4baed 100644 --- a/src/lib/lbaselib.c +++ b/src/lib/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.130a 2003/04/03 13:35:34 roberto Exp $ +** $Id: lbaselib.c,v 1.130b 2003/04/03 13:35:34 roberto Exp $ ** Basic library ** See Copyright Notice in lua.h */ @@ -274,10 +274,11 @@ static int luaB_loadfile (lua_State *L) { static int luaB_dofile (lua_State *L) { const char *fname = luaL_optstring(L, 1, NULL); + int n = lua_gettop(L); int status = luaL_loadfile(L, fname); if (status != 0) lua_error(L); lua_call(L, 0, LUA_MULTRET); - return lua_gettop(L) - 1; + return lua_gettop(L) - n; } @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 1.284a 2003/04/03 13:35:34 roberto Exp $ +** $Id: lvm.c,v 1.284b 2003/04/03 13:35:34 roberto Exp $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -399,8 +399,10 @@ StkId luaV_execute (lua_State *L) { TObject *k; const Instruction *pc; callentry: /* entry point when calling new functions */ - if (L->hookmask & LUA_MASKCALL) + if (L->hookmask & LUA_MASKCALL) { + L->ci->u.l.pc = &pc; luaD_callhook(L, LUA_HOOKCALL, -1); + } retentry: /* entry point when returning to old functions */ L->ci->u.l.pc = &pc; lua_assert(L->ci->state == CI_SAVEDPC || @@ -776,3 +778,4 @@ StkId luaV_execute (lua_State *L) { } } + |