** Traces Lua calls. If code is running the first instruction of a function, ** and function is not vararg, and it is not coming from an yield, ** calls 'luaD_hookcall'. (Vararg functions will call 'luaD_hookcall' ** after adjusting its variable arguments; otherwise, they could call ** a line/count hook before the call hook. Functions coming from ** an yield already called 'luaD_hookcall' before y
| 900 | ** an yield already called 'luaD_hookcall' before yielding.) |
| 901 | */ |
| 902 | int luaG_tracecall (lua_State *L) { |
| 903 | CallInfo *ci = L->ci; |
| 904 | Proto *p = ci_func(ci)->p; |
| 905 | ci->u.l.trap = 1; /* ensure hooks will be checked */ |
| 906 | if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */ |
| 907 | if (p->is_vararg) |
| 908 | return 0; /* hooks will start at VARARGPREP instruction */ |
| 909 | else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */ |
| 910 | luaD_hookcall(L, ci); /* check 'call' hook */ |
| 911 | } |
| 912 | return 1; /* keep 'trap' on */ |
| 913 | } |
| 914 | |
| 915 | |
| 916 | /* |
no test coverage detected