Skip to content

Commit

Permalink
#257 Check if proto-code is available before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Jun 9, 2024
1 parent d0f5d4b commit 25953d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ldebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ static const char *funcnamefromcode (lua_State *L, CallInfo *ci,

static int currentpc (CallInfo *ci) {
lua_assert(isLua(ci));
/* If this function was compiled using the source to JIT then no code available */
if (ci_func(ci)->p->code == NULL)
return 0;
return pcRel(ci->u.l.savedpc, ci_func(ci)->p);
}

Expand Down

0 comments on commit 25953d5

Please sign in to comment.