Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Prevent snapshot purge while recording a function header.
Date: Tue, 3 Mar 2026 15:01:22 +0300	[thread overview]
Message-ID: <aabNkgwhK_MXVKX1@root> (raw)
In-Reply-To: <0aee43fd-f0a6-410b-b67b-10461724a66f@tarantool.org>

Hi, Sergey!
Thanks for the review!
See my answer below.

On 03.03.26, Sergey Bronnikov wrote:
> Hi, Sergey,
> 
> thanks for the patch! LGTM with a minor comment.
> 
> Sergey
> 
> On 2/25/26 15:11, Sergey Kaplun wrote:

<snipped>

> > +
> > +local checkers = {}
> > +
> > +-- Called twice for the pseudo-type that aliases base Lua type via
> > +-- checkers map.
> > +local function checks(expected_type)
> > +  -- Value expected to be `checks_tab()` or `checks_obj()`
> > +  -- argument. It is always a table.
> > +  local _, value = debug_getlocal(2, 1)
> > +  -- Simple stitching function. Additional arguments are needed to
> > +  -- occupy the corresponding slot.
> 
> It is not clear for me why this corresponding slot is needed.
> 
> The bug can be reproduced without double nil's passed to math_modf().

Not for all builds (i.e. GC64 and non-GC64).

> 
> > +  math_modf(0, nil, nil)
> > +  -- Start trace now, one iteration only.
> > +  -- luacheck: ignore 512
> > +  while true do
> > +    -- Base type?
> > +    if type(value) == expected_type then
> > +      return true
> > +    end
> > +    -- Pseudo types fallbacks to the map.
> > +    local checker = checkers[expected_type]
> > +    -- For the xpcall.
> > +    if checker(value) == true then
> > +      return true
> > +    end
> > +    break
> > +  end
> > +  error('Unreachable path taken')
> > +end

<snipped>

-- 
Best regards,
Sergey Kaplun

      reply	other threads:[~2026-03-03 12:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 12:11 Sergey Kaplun via Tarantool-patches
2026-03-03 10:44 ` Sergey Bronnikov via Tarantool-patches
2026-03-03 12:01   ` Sergey Kaplun via Tarantool-patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aabNkgwhK_MXVKX1@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] Prevent snapshot purge while recording a function header.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox