<HTML><BODY><div>Hi, Sergey! Thanks for the review!</div><div>Here is the new commit message considering your comments:</div><div> </div><div>=======================================================</div><div><div><div>test: adapt tests checking traceback in tail call</div></div><div> </div><div>LuaJIT does not provide information about tail calls,</div><div><div>unlike, Lua 5.1 does, so a traceback in LuaJIT may be different.</div></div><div> </div><div><div>Consider this chunck of code:</div><div>```</div><div>local function f(n)</div><div>    if n > 0 then</div><div>        return f(n - 1)</div><div>    else</div><div>        coroutine.yield()</div><div>    end</div><div>end</div></div><div> </div><div>local co = coroutine.create(f)</div><div><div>coroutine.resume(co, 3)</div><div>print(debug.traceback(co))</div><div>```</div></div><div> </div><div>For LuaJIT traceback looks like the following:</div><div>stack traceback:</div><div><div>            [C]: in function 'yield'</div><div>            test.lua:5: in function <test.lua:1></div><div>```</div></div><div> </div><div>And for Lua 5.1 it looks like the following:</div><div><div>```</div><div>stack traceback:</div><div>            [C]: in function 'yield'</div><div>            test.lua:5: in function <test.lua:1></div><div>            (tail call): ?</div><div>            (tail call): ?</div><div>            (tail call): ?</div><div>```</div></div><div> </div><div>This commit adapts the corresponding test to the behavior of LuaJIT, so</div><div><div>it doesn't check tail calls anymore.</div></div><div> </div><div>Part of tarantool/tarantool#5870</div><div><div>=======================================================</div></div></div><div> </div><div>CI: <a href="https://github.com/tarantool/tarantool/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio">https://github.com/tarantool/tarantool/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio</a></div><div> </div><div>Best regards,</div><div>Maxim Kokryashkin</div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Понедельник, 11 октября 2021, 18:13 +03:00 от Sergey Kaplun <skaplun@tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16339652161290428658_BODY">Hi, Maxim!<br><br>Thanks for the patch!<br><br>LGTM except a few nits, regarding the commit message.<br><br>On 24.09.21, Maxim Kokryashkin wrote:<br>> LuaJIT does not provide information about tail calls<br><br>Typo: s/calls/calls,/<br><br>> unlike, Lua 5.1 does, so a traceback in LuaJIT may be different.<br>><br>> Consider this chunck of code:<br>> ```<br>> local function checktraceback (co, p)<br>> local tb = debug.traceback(co)<br>> local i = 0<br>> for l in string.gmatch(tb, "[^\n]+\n?") do<br>> assert(i == 0 or string.find(l, p[i]))<br>> i = i+1<br>> end<br>> assert(p[i] == nil)<br>> end<br>><br>> local function f (n)<br>> if n > 0 then return f(n-1)<br>> else coroutine.yield() end<br>> end<br>><br>> local co = coroutine.create(f)<br>> coroutine.resume(co, 3)<br>> checktraceback(co, {"yield", "db.lua", "tail", "tail", "tail"})<br>> ```<br>><br>> For LuaJIT traceback looks like the following:<br>> ```<br>> stack traceback:<br>> [C]: in function 'yield'<br>> db.lua:436: in function <db.lua:434><br>> ```<br>><br>> And for Lua 5.1 it looks like the following:<br>> ```<br>> stack traceback:<br>> [C]: in function 'yield'<br>> db.lua:436: in function <db.lua:434><br>> (tail call): ?<br>> (tail call): ?<br>> (tail call): ?<br>> ```<br><br>Please provide a simple example in the commit message. This is too<br>monstrous. Also, it is a good practice to mention what the patch does.<br><br>><br>> Closes tarantool/tarantool#5703<br>> Part of tarantool/tarantool#5845<br>> Part of tarantool/tarantool#4473<br><br>Looks like it should be 5870 instead 4473. Also, 5845 is already<br>closed.<br><br>> ---<br>> Issue: <a href="https://github.com/tarantool/tarantool/issues/5703" target="_blank">https://github.com/tarantool/tarantool/issues/5703</a><br>> GitHub branch: <a href="https://github.com/tarantool/luajit/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio" target="_blank">https://github.com/tarantool/luajit/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio</a><br>><br>> test/PUC-Rio-Lua-5.1-tests/db.lua | 5 ++---<br>> 1 file changed, 2 insertions(+), 3 deletions(-)<br>><br>> diff --git a/test/PUC-Rio-Lua-5.1-tests/db.lua b/test/PUC-Rio-Lua-5.1-tests/db.lua<br>> index 56f59ea8..f254cde6 100644<br>> --- a/test/PUC-Rio-Lua-5.1-tests/db.lua<br>> +++ b/test/PUC-Rio-Lua-5.1-tests/db.lua<br><br><snipped><br><br>> --<br>> 2.33.0<br>><br><br>--<br>Best regards,<br>Sergey Kaplun</div></div></div></div></blockquote><div> </div></BODY></HTML>