Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/ldo.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,16 @@ int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func,
#if YKLUA_DEBUG_STRS
yk_location_set_debug_str(&p->yklocs[0], p->instdebugstrs[0]);
#endif
} else if (!p->called) {
p->called = true;
}
// Because this is a tail call the "current" function -- `caller_p` --
// has implicitly returned. If the "current" function is the same as
// the "about to call" function, we don't do anything; in all other
// cases we mark the "current" function as uncalled.
Proto *caller_p = ci_func(ci)->p;
if (caller_p != p)
caller_p->called = false;
}
#endif
ci->u.l.savedpc = p->code; /* starting point */
Expand Down