[Tarantool-patches] [PATCH luajit] test: adapt tests checking traceback in tail call

Igor Munkin imun at tarantool.org
Fri Feb 11 22:12:34 MSK 2022


Max,

Thanks for the patch! LGTM, except a couple of nits.

On 09.11.21, Максим Корякшин wrote:
> 
> Hi, Sergey! Thanks for the review!
> Here is the new commit message considering your comments:
>  
> =======================================================
> test: adapt tests checking traceback in tail call
>  
> LuaJIT does not provide information about tail calls,
> unlike, Lua 5.1 does, so a traceback in LuaJIT may be different.
>  
> Consider this chunck of code:

Typo: s/chunck/chunk/.

> ```
> local function f(n)
>     if n > 0 then
>         return f(n - 1)
>     else
>         coroutine.yield()
>     end
> end
>  
> local co = coroutine.create(f)
> coroutine.resume(co, 3)
> print(debug.traceback(co))
> ```
>  
> For LuaJIT traceback looks like the following:
> stack traceback:
>             [C]: in function 'yield'
>             test.lua:5: in function <test.lua:1>
> ```
>  
> And for Lua 5.1 it looks like the following:
> ```
> stack traceback:
>             [C]: in function 'yield'
>             test.lua:5: in function <test.lua:1>
>             (tail call): ?
>             (tail call): ?
>             (tail call): ?
> ```
>  
> This commit adapts the corresponding test to the behavior of LuaJIT, so
> it doesn't check tail calls anymore.
>  

Please, add "Resolves tarantool/tarantool#5703" here.

> Part of tarantool/tarantool#5870
> =======================================================
>  
> CI:  https://github.com/tarantool/tarantool/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio
>  
> Best regards,
> Maxim Kokryashkin

<snipped>

>  

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list