MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / instack

Function instack

third-party/lua-5.4.6/src/ldebug.c:690–698  ·  view source on GitHub ↗

** Check whether pointer 'o' points to some value in the stack frame of ** the current function and, if so, returns its index. Because 'o' may ** not point to a value in this stack, we cannot compare it with the ** region boundaries (undefined behavior in ISO C). */

Source from the content-addressed store, hash-verified

688** region boundaries (undefined behavior in ISO C).
689*/
690static int instack (CallInfo *ci, const TValue *o) {
691 int pos;
692 StkId base = ci->func.p + 1;
693 for (pos = 0; base + pos < ci->top.p; pos++) {
694 if (o == s2v(base + pos))
695 return pos;
696 }
697 return -1; /* not found */
698}
699
700
701/*

Callers 1

varinfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected