lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 5fa2bec1f06f5b935036bd9e7c6a65b82f88dd39
parent 746a1d612b975e1ec2b0ea906e6932f2497f5391
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 13 Jun 2005 11:15:00 -0300

bug: current line should work for call hook

Diffstat:
Mlvm.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 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;