diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-06-14 13:28:21 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-06-14 13:28:21 -0300 |
| commit | 04e19712a5d48b84869f9942836ff8314fb0be8e (patch) | |
| tree | 75aab8dff5bdf07026080eba0189e4025ec3b7ee /testes/errors.lua | |
| parent | 901d76009346d76996679c02deee708bf225e91e (diff) | |
| download | lua-github-04e19712a5d48b84869f9942836ff8314fb0be8e.tar.gz | |
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.
Diffstat (limited to 'testes/errors.lua')
| -rw-r--r-- | testes/errors.lua | 4 |
1 files changed, 2 insertions, 2 deletions
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") |
