summaryrefslogtreecommitdiff
path: root/lib/lua/src/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lua/src/lvm.c')
-rw-r--r--lib/lua/src/lvm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/lua/src/lvm.c b/lib/lua/src/lvm.c
index 6c07b0f..adca9b2 100644
--- a/lib/lua/src/lvm.c
+++ b/lib/lua/src/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 1.5 2004-11-27 21:46:07 pixel Exp $
+** $Id: lvm.c,v 1.6 2004-12-27 19:52:24 pixel Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -66,7 +66,7 @@ int luaV_tostring (lua_State *L, StkId obj) {
static void traceexec (lua_State *L) {
lu_byte mask = L->hookmask;
- if (mask > LUA_MASKLINE) { /* instruction-hook set? */
+ if (mask > LUA_MASKCOUNT) { /* instruction-hook set? */
if (L->hookcount == 0) {
resethookcount(L);
luaD_callhook(L, LUA_HOOKCOUNT, -1);
@@ -399,10 +399,12 @@ StkId luaV_execute (lua_State *L) {
TObject *k;
const Instruction *pc;
callentry: /* entry point when calling new functions */
- L->ci->u.l.pc = &pc;
- 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 ||
L->ci->state == (CI_SAVEDPC | CI_CALLING));
L->ci->state = CI_HASFRAME; /* activate frame */
@@ -677,9 +679,7 @@ StkId luaV_execute (lua_State *L) {
}
else { /* yes: continue its execution */
int nresults;
- lua_assert(ci->u.l.pc == &pc &&
- ttisfunction(ci->base - 1) &&
- (ci->state & CI_SAVEDPC));
+ lua_assert(ttisfunction(ci->base - 1) && (ci->state & CI_SAVEDPC));
lua_assert(GET_OPCODE(*(ci->u.l.savedpc - 1)) == OP_CALL);
nresults = GETARG_C(*(ci->u.l.savedpc - 1)) - 1;
luaD_poscall(L, nresults, ra);