<!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>Thanks! LGTM<br>
    </p>
    <div class="moz-cite-prefix">On 12.09.2024 13:16, Sergey Kaplun
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:ZuK_jd-zEBBDCU5r@root">
      <pre class="moz-quote-pre" wrap="">On 10.09.24, Sergey Kaplun via Tarantool-patches wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Hi, Sergey!
Thanks for the review!

On 10.09.24, Sergey Bronnikov wrote:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Hi, Sergey,

On 09.09.2024 18:37, Sergey Bronnikov via Tarantool-patches wrote:
</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">
Hi, Sergey,

thanks for the patch! see my comments below.

On 21.08.2024 19:52, Sergey Kaplun wrote:
</pre>
            <blockquote type="cite">
              <pre class="moz-quote-pre" wrap="">From: Mike Pall <mike>

</pre>
            </blockquote>
          </blockquote>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
<snipped>

</pre>
        <blockquote type="cite">
          <blockquote type="cite">
            <blockquote type="cite">
              <pre class="moz-quote-pre" wrap="">---

Branch:<a class="moz-txt-link-freetext" href="https://github.com/tarantool/luajit/tree/skaplun/lj-1224-fix-jit-cdata-arith">https://github.com/tarantool/luajit/tree/skaplun/lj-1224-fix-jit-cdata-arith</a>
Related issues:
*<a class="moz-txt-link-freetext" href="https://github.com/tarantool/tarantool/issues/10199">https://github.com/tarantool/tarantool/issues/10199</a>
*<a class="moz-txt-link-freetext" href="https://github.com/LuaJIT/LuaJIT/issues/1224">https://github.com/LuaJIT/LuaJIT/issues/1224</a>

  src/lj_crecord.c                              | 10 ++--
  .../lj-1224-fix-cdata-arith-ptr.test.lua      | 48 +++++++++++++++++++
</pre>
            </blockquote>
            <pre class="moz-quote-pre" wrap="">
This test does not fail without fix (but repro from the issue does):

[0] ~/sources/MRG/tarantool/third_party/luajit $ 
./build/gc64/src/luajit -Ohotloop=1 -e "
repeat
  r = 1LL + nil
until true
"
LuaJIT ASSERT 
/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj_ctype.c:185: 
lj_ctype_intern: uninitialized cts->L
Aborted
[0] ~/sources/MRG/tarantool/third_party/luajit $ 
./build/gc64/src/luajit 
test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
TAP version 13
1..2
    # cdata arithmetic with nil
1..2
    ok - correct recording error with bad cdata arithmetic
    ok - correct error message
    # cdata arithmetic with nil: end
ok - cdata arithmetic with nil
    # cdata arithmetic with string
    1..2
    ok - correct recording error with bad cdata arithmetic
    ok - correct error message
    # cdata arithmetic with string: end
ok - cdata arithmetic with string
[0] ~/sources/MRG/tarantool/third_party/luajit $

</pre>
          </blockquote>
          <pre class="moz-quote-pre" wrap="">
With GC64 only (LUAJIT_ENABLE_GC64).
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
It don't fail with GC64?

Should I add the comment?
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
I've added the following comment to avoid the confusion.
Branch is force-pushed.

===================================================================
diff --git a/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua b/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
index 9de9586d..dd7e23ec 100644
--- a/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
+++ b/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
@@ -11,6 +11,8 @@ local test = tap.test('lj-1224-fix-cdata-arith-ptr'):skipcond({
 
 test:plan(2)
 
+-- XXX: This test leads to the assertion failure before the patch
+-- only for non-GC64 build.
 local function arith_nil_protected()
   local i = 1
   while i < 3 do
===================================================================

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap=""><snipped>
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
-- 
Best regards,
Sergey Kaplun
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
  </body>
  <lt-container></lt-container>
</html>