Handling of the interrupted OP_TAILCALL instruction

51 views
Skip to first unread message

Jure Bagić

unread,
Nov 24, 2025, 11:05:30 PM (3 days ago) Nov 24
to lua-l
Just wondering if 'luaV_finishOp' relies on fall-through to the OP_RETURN
instruction in order to properly put results in correct place in case the
interrupted opcode is OP_TAILCALL (in case the called function is C and the
caller is Lua vararg function)?
(I see no other way, as 'default' case is empty.)
-- Jure
signature.asc

Roberto Ierusalimschy

unread,
10:52 AM (7 hours ago) 10:52 AM
to lu...@googlegroups.com
(I am not sure what you mean by "fall-through" here.) An OP_TAILCALL
is always followed by OP_RETURN. If OP_TAILCALL is interrupted, the
OP_RETURN will naturally be the next instruction to be executed and then
it will complete the task.

-- Roberto
Reply all
Reply to author
Forward
0 new messages