diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-18 15:39:06 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-18 15:39:06 -0200 |
commit | 448517e47e40814f6ee12eae8dd6c3120f1d48bb (patch) | |
tree | 46884b1c0793e05276f5ee3111d7b52f6535a268 /lvm.c | |
parent | 931ee346e34aeb9d46bbf99f5da1f628a9812050 (diff) | |
download | lua-448517e47e40814f6ee12eae8dd6c3120f1d48bb.tar.gz lua-448517e47e40814f6ee12eae8dd6c3120f1d48bb.tar.bz2 lua-448517e47e40814f6ee12eae8dd6c3120f1d48bb.zip |
no more linehook field in CallInfo
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -66,10 +66,17 @@ static void traceexec (lua_State *L, lua_Hook linehook) { | |||
66 | int *lineinfo = ci_func(ci)->l.p->lineinfo; | 66 | int *lineinfo = ci_func(ci)->l.p->lineinfo; |
67 | int pc = cast(int, *ci->pc - ci_func(ci)->l.p->code) - 1; | 67 | int pc = cast(int, *ci->pc - ci_func(ci)->l.p->code) - 1; |
68 | int newline; | 68 | int newline; |
69 | if (pc == 0) { /* may be first time? */ | 69 | if (ci->line == -1) return; /* no linehooks for this function */ |
70 | ci->line = 1; | 70 | else if (ci->line == 0) { /* first linehook? */ |
71 | ci->refi = 0; | 71 | if (pc == 0) { /* function is starting now? */ |
72 | ci->lastpc = pc+1; /* make sure it will call linehook */ | 72 | ci->line = 1; |
73 | ci->refi = 0; | ||
74 | ci->lastpc = pc+1; /* make sure it will call linehook */ | ||
75 | } | ||
76 | else { /* function started without hooks: */ | ||
77 | ci->line = -1; /* keep it that way */ | ||
78 | return; | ||
79 | } | ||
73 | } | 80 | } |
74 | newline = luaG_getline(lineinfo, pc, ci->line, &ci->refi); | 81 | newline = luaG_getline(lineinfo, pc, ci->line, &ci->refi); |
75 | /* calls linehook when enters a new line or jumps back (loop) */ | 82 | /* calls linehook when enters a new line or jumps back (loop) */ |
@@ -315,7 +322,7 @@ StkId luaV_execute (lua_State *L) { | |||
315 | base = L->ci->base; | 322 | base = L->ci->base; |
316 | cl = &clvalue(base - 1)->l; | 323 | cl = &clvalue(base - 1)->l; |
317 | k = cl->p->k; | 324 | k = cl->p->k; |
318 | linehook = L->ci->linehook; | 325 | linehook = L->linehook; |
319 | L->ci->pc = &pc; | 326 | L->ci->pc = &pc; |
320 | pc = L->ci->savedpc; | 327 | pc = L->ci->savedpc; |
321 | L->ci->savedpc = NULL; | 328 | L->ci->savedpc = NULL; |
@@ -513,7 +520,6 @@ StkId luaV_execute (lua_State *L) { | |||
513 | int nresults; | 520 | int nresults; |
514 | lua_assert(ttype(ci->base-1) == LUA_TFUNCTION); | 521 | lua_assert(ttype(ci->base-1) == LUA_TFUNCTION); |
515 | base = ci->base; /* restore previous values */ | 522 | base = ci->base; /* restore previous values */ |
516 | linehook = ci->linehook; | ||
517 | cl = &clvalue(base - 1)->l; | 523 | cl = &clvalue(base - 1)->l; |
518 | k = cl->p->k; | 524 | k = cl->p->k; |
519 | pc = ci->savedpc; | 525 | pc = ci->savedpc; |