| 14891 | |
| 14892 | |
| 14893 | static void traceexec (lua_State *L, const Instruction *pc) { |
| 14894 | lu_byte mask = L->hookmask; |
| 14895 | const Instruction *oldpc = L->savedpc; |
| 14896 | L->savedpc = pc; |
| 14897 | if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { |
| 14898 | resethookcount(L); |
| 14899 | luaD_callhook(L, LUA_HOOKCOUNT, -1); |
| 14900 | } |
| 14901 | if (mask & LUA_MASKLINE) { |
| 14902 | Proto *p = ci_func(L->ci)->l.p; |
| 14903 | int npc = pcRel(pc, p); |
| 14904 | int newline = lua_getline(p, npc); |
| 14905 | /* call linehook when enter a new function, when jump back (loop), |
| 14906 | or when enter a new line */ |
| 14907 | if (npc == 0 || pc <= oldpc || newline != lua_getline(p, pcRel(oldpc, p))) |
| 14908 | luaD_callhook(L, LUA_HOOKLINE, newline); |
| 14909 | } |
| 14910 | } |
| 14911 | |
| 14912 | |
| 14913 | static void callTMres (lua_State *L, StkId res, const TValue *f, |
no test coverage detected