<!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 the patch! LGTM with a minor comment below.</p>
    <p>Sergey<br>
    </p>
    <div class="moz-cite-prefix">On 10.03.2025 17:51, Sergey Kaplun
      wrote:<br>
    </div>
    <p><snipped><br>
    </p>
    <blockquote type="cite"
cite="mid:9dbb7d455c1953fcab6a82944b073348c17e46ac.1741617766.git.skaplun@tarantool.org">
      <pre wrap="" class="moz-quote-pre">
diff --git a/test/tarantool-tests/lj-1298-oom-on-concat-recording.test.lua b/test/tarantool-tests/lj-1298-oom-on-concat-recording.test.lua
new file mode 100644
index 00000000..961df798
--- /dev/null
+++ b/test/tarantool-tests/lj-1298-oom-on-concat-recording.test.lua
@@ -0,0 +1,53 @@
+local tap = require('tap')
+
+-- Test file to demonstrate unbalanced Lua stack after instruction
+-- recording due to throwing an OOM error at the moment of
+-- recording without restoring the Lua stack back.
+-- See also: <a class="moz-txt-link-freetext" href="https://github.com/LuaJIT/LuaJIT/issues/1298">https://github.com/LuaJIT/LuaJIT/issues/1298</a>.
+
+local test = tap.test('lj-1298-oom-on-concat-recording'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
+local allocinject = require('allocinject')
+
+test:plan(2)
+
+jit.opt.start('hotloop=1')
+
+-- Allocation limit to return `NULL`.
+local ALLOC_LIMIT = 2048
+
+local bigstr = string.rep('x', ALLOC_LIMIT)
+local __concat = function()
+  return 'concated'</pre>
    </blockquote>
    s/concated/concatenated/<br>
    <p><br>
    </p>
    <p><snipped><br>
    </p>
  </body>
  <lt-container></lt-container>
</html>