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

Function instack

third-party/lua-5.5.0/src/ldebug.c:685–693  ·  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

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

Callers 1

varinfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected