1
0
mirror of https://github.com/lua/lua synced 2026-06-08 15:34:49 +00:00

C functions can be tail called, too

A tail call to a C function can have the behavior of a "real" tail
call, reusing the stack frame of the caller.
This commit is contained in:
Roberto Ierusalimschy
2021-06-14 13:28:21 -03:00
parent 901d760093
commit 04e19712a5
4 changed files with 29 additions and 29 deletions
+1 -1
View File
@@ -205,7 +205,7 @@ do
co = coroutine.create(function () return pcall(foo) end)
local st1, st2, err = coroutine.resume(co)
assert(st1 and not st2 and err == 43)
assert(X == 43 and Y.name == "pcall")
assert(X == 43 and Y.what == "C")
-- recovering from errors in __close metamethods
local track = {}