From 5fa2bec1f06f5b935036bd9e7c6a65b82f88dd39 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 13 Jun 2005 11:15:22 -0300 Subject: [PATCH] bug: current line should work for call hook --- lvm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lvm.c b/lvm.c index c44ac8c6..1c5beb77 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.45 2005/05/20 15:53:42 roberto Exp roberto $ +** $Id: lvm.c,v 2.46 2005/05/31 14:25:18 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -364,8 +364,11 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { TValue *k; const Instruction *pc; callentry: /* entry point when calling new functions */ - if (L->hookmask & LUA_MASKCALL) + if (L->hookmask & LUA_MASKCALL) { + L->savedpc++; /* hooks assume 'pc' is already incremented */ luaD_callhook(L, LUA_HOOKCALL, -1); + L->savedpc--; /* correct 'pc' */ + } retentry: /* entry point when returning to old functions */ pc = L->savedpc; cl = &clvalue(L->ci->func)->l;