aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/lvm.c b/lvm.c
index 0ea8ea9f..1a7629de 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.120 2000/06/30 14:35:17 roberto Exp roberto $ 2** $Id: lvm.c,v 1.121 2000/08/08 18:26:05 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -71,19 +71,17 @@ static void traceexec (lua_State *L, StkId base, StkId top, lua_Hook linehook) {
71 CallInfo *ci = infovalue(base-1); 71 CallInfo *ci = infovalue(base-1);
72 int *lineinfo = ci->func->f.l->lineinfo; 72 int *lineinfo = ci->func->f.l->lineinfo;
73 int pc = (*ci->pc - 1) - ci->func->f.l->code; 73 int pc = (*ci->pc - 1) - ci->func->f.l->code;
74 if (lineinfo) { 74 int newline;
75 int newline; 75 if (ci->line == 0) { /* first time? */
76 if (ci->line == 0) { /* first time? */ 76 ci->line = 1;
77 ci->line = 1; 77 ci->refi = 0;
78 ci->refi = 0; 78 }
79 } 79 newline = luaG_getline(lineinfo, pc, ci->line, &ci->refi);
80 newline = luaG_getline(lineinfo, pc, ci->line, &ci->refi); 80 /* calls linehook when enters a new line or jumps back (loop) */
81 /* calls linehook when enters a new line or jumps back (loop) */ 81 if (newline != ci->line || pc <= ci->lastpc) {
82 if (newline != ci->line || pc <= ci->lastpc) { 82 ci->line = newline;
83 ci->line = newline; 83 L->top = top;
84 L->top = top; 84 luaD_lineHook(L, base-2, newline, linehook);
85 luaD_lineHook(L, base-2, newline, linehook);
86 }
87 } 85 }
88 ci->lastpc = pc; 86 ci->lastpc = pc;
89} 87}