From 04e19712a5d48b84869f9942836ff8314fb0be8e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 14 Jun 2021 13:28:21 -0300 Subject: 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. --- testes/errors.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testes/errors.lua') diff --git a/testes/errors.lua b/testes/errors.lua index a3d0676b..825f37c2 100644 --- a/testes/errors.lua +++ b/testes/errors.lua @@ -26,7 +26,7 @@ end local function checkmessage (prog, msg, debug) local m = doit(prog) - if debug then print(m) end + if debug then print(m, msg) end assert(string.find(m, msg, 1, true)) end @@ -289,7 +289,7 @@ end]], "global 'insert'") checkmessage([[ -- tail call return math.sin("a") -]], "'sin'") +]], "sin") checkmessage([[collectgarbage("nooption")]], "invalid option") -- cgit v1.2.3-55-g6feb