<!DOCTYPE html>
<html data-lt-installed="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body style="padding-bottom: 1px;">
<p>Hi, Sergey,</p>
<p>see the answer below</p>
<p>Sergey</p>
<div class="moz-cite-prefix">On 3/4/26 12:49, Sergey Kaplun wrote:<br>
</div>
<blockquote type="cite" cite="mid:aagAGsrJaS6BHtiH@root">
<pre wrap="" class="moz-quote-pre">Sergey,
On 16.02.26, Sergey Bronnikov wrote:
</pre>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">Hi, Sergey,
thanks for review!
On 2/11/26 11:30, Sergey Kaplun via Tarantool-patches wrote:
</pre>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">On 10.12.25, Sergey Bronnikov wrote:
</pre>
</blockquote>
</blockquote>
<pre wrap="" class="moz-quote-pre">
<snipped>
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c
index a44a5adf..431cb3c2 100644
--- a/src/lj_dispatch.c
+++ b/src/lj_dispatch.c
@@ -453,7 +453,7 @@ static int call_init(lua_State *L, GCfunc *fn)
int numparams = pt->numparams;
int gotparams = (int)(L->top - L->base);
int need = pt->framesize;
- if ((pt->flags & PROTO_VARARG)) need += 1+gotparams;
+ if ((pt->flags & PROTO_VARARG)) need += 1+LJ_FR2+gotparams;
lj_state_checkstack(L, (MSize)need);
numparams -= gotparams;
return numparams >= 0 ? numparams : 0;
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">Let's add an additional test for this part of code (since we don't have
any). It may be taken from [1]. It doesn't fail now, but we may cover
this branch more precise.
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">
Don't get what do you mean.
true branch in gc32 is covered by the following tests:
test/LuaJIT-tests
test/PUC-Rio-Lua-5.1-tests
test/tarantool-c-tests/lj-1087-vm-handler-call.c_test
test/tarantool-tests/fix-ff-select-recording.test.lua
test/tarantool-tests/fix-mips64-spare-side-exit-patching.test.lua
test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
test/tarantool-tests/fix-slots-overflow-for-varg-record.test.lua
test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
test/tarantool-tests/lj-1024-varg-maxslot.test.lua
test/tarantool-tests/lj-1025-tsetm-maxslot.test.lua
test/tarantool-tests/lj-1026-arm64-invalid-hrefk-offset-check.test.lua
test/tarantool-tests/lj-1046-fix-bc-varg-recording.test.lua
test/tarantool-tests/lj-1164-record-meta-concat-varg-pcall.test.lua
test/tarantool-tests/lj-1295-bad-renames-for-sunk-values.test.lua
test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
test/tarantool-tests/lj-704-bc-varg-use-def.test.lua
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">
Just the true branch isn't enough. We need the true branch when the
stack needs to be reallocated, like in the [1]. When I check this issue
(with 1 removed) none of our tests catches the incorrect behaviour. You
may refer to the test like lj-1402-vararg-realloc-check.test.lua. The
comment in the test should clarify that this is to avoid regressions in
the future.
</pre>
</blockquote>
<p>A new file with test was added (see
test/tarantool-tests/gh-1402-call_init-regression.test.lua).</p>
<p>The branch was force-pushed.</p>
<blockquote type="cite" cite="mid:aagAGsrJaS6BHtiH@root">
<pre wrap="" class="moz-quote-pre">
<snipped>
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">[1]:<a class="moz-txt-link-freetext" href="https://github.com/LuaJIT/LuaJIT/issues/1402#issue-3569942423">https://github.com/LuaJIT/LuaJIT/issues/1402#issue-3569942423</a>
</pre>
</blockquote>
</blockquote>
<pre wrap="" class="moz-quote-pre">
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>