<!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>thanks for fixes! LGTM<br>
</p>
<div class="moz-cite-prefix">On 13.09.2024 18:48, Sergey Kaplun
wrote:<br>
</div>
<blockquote type="cite" cite="mid:ZuRe5ymlfY5cY8_1@root">
<pre class="moz-quote-pre" wrap="">One more minor update below.
On 13.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 13.09.24, Sergey Bronnikov wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Hi, Sergey,
thanks for the patch! LGTM with a minor comment. See below.
On 21.08.2024 11:23, Sergey Kaplun wrote:
<snipped>
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">+-- Need to use metamethod call in the concat recording.
+debug.setmetatable(nil, {
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">I propose to add a comment that explain why `nil` is used here.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
I've removed the nil usage to avoid confusion.
Branch is rebased on the current master and force-pushed.
===================================================================
diff --git a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua
index 9abaeba5..4fe02708 100644
--- a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua
+++ b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua
@@ -12,12 +12,13 @@ test:plan(2)
jit.opt.start('hotloop=1')
-local __concat = function(v1, v2)
- return tostring(v1) .. tostring(v2)
+local __concat = function()
+ return ''
end
-- Need to use metamethod call in the concat recording.
-debug.setmetatable(nil, {
+-- Let's use a table with the metamethod.
+local concatable_t = setmetatable({}, {
__concat = __concat,
})
@@ -31,7 +32,7 @@ local function test_concat_p()
-- `lj_record_ret()` restore the Lua stack (before the patch),
-- it becomes unbalanced after the instruction recording
-- attempt.
- local _ = {} .. (nil .. nil)
+ local _ = {} .. (concatable_t .. concatable_t)
end
end
===================================================================
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Added more verbose description:
===================================================================
diff --git a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua
index 4fe02708..75736e74 100644
--- a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua
+++ b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua
@@ -17,7 +17,8 @@ local __concat = function()
end
-- Need to use metamethod call in the concat recording.
--- Let's use a table with the metamethod.
+-- We may use any object with a metamethod, but let's use a table
+-- as the most common one.
local concatable_t = setmetatable({}, {
__concat = __concat,
})
===================================================================
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">+ __concat = __concat,
+})
+
</pre>
</blockquote>
</blockquote>
<pre class="moz-quote-pre" wrap="">
<snipped>
--
Best regards,
Sergey Kaplun
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>