MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / instack

Function instack

lib/lua/src/ldebug.c:681–689  ·  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

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

Callers 1

varinfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected