[Tarantool-patches] [PATCH luajit 1/2] Fix edge cases when generating IR for string.byte/sub/find.

Sergey Bronnikov sergeyb at tarantool.org
Tue Mar 10 10:29:05 MSK 2026


Hi, Sergey,

thanks for the patch! LGTM with a minor comment below.

Sergey

On 3/6/26 16:42, Sergey Kaplun wrote:
> From: Mike Pall <mike>
>
> Contributed by XmiliaH.
>
> (cherry picked from commit af9763a50da87ff8ba16e828cbd5664135e05a88)
>
> The generated ADD/SUB IRs for the calculation of indexes in the string
> for the aforementioned build-ins don't check the overflow. This may lead
s/build-ins/built-ins/
> to the incorrect results, incorrect trace semantics, or invalid memory
> access. Also, the negative values may pass the UGT guard check emitted
> for the positive `end` position and lead to the incorrect results on the
> trace.
>
> This patch fixes this by using guarded ADDOV/SUBOV instead. The UGT IR
> is replaced with GT.
>
> Sergey Kaplun:
> * added the description and the test for the problem
>
> Part of tarantool/tarantool#12134
> ---

<snipped>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20260310/4e813c2a/attachment.htm>


More information about the Tarantool-patches mailing list