| 58 | |
| 59 | |
| 60 | static void traceexec (lua_State *L, const Instruction *pc) { |
| 61 | lu_byte mask = L->hookmask; |
| 62 | const Instruction *oldpc = L->savedpc; |
| 63 | L->savedpc = pc; |
| 64 | if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { |
| 65 | resethookcount(L); |
| 66 | luaD_callhook(L, LUA_HOOKCOUNT, -1); |
| 67 | } |
| 68 | if (mask & LUA_MASKLINE) { |
| 69 | Proto *p = ci_func(L->ci)->l.p; |
| 70 | int npc = pcRel(pc, p); |
| 71 | int newline = getline(p, npc); |
| 72 | /* call linehook when enter a new function, when jump back (loop), |
| 73 | or when enter a new line */ |
| 74 | if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) |
| 75 | luaD_callhook(L, LUA_HOOKLINE, newline); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | |
| 80 | static void callTMres (lua_State *L, StkId res, const TValue *f, |
no test coverage detected