[Tarantool-patches] [PATCH luajit] Add missing LJ_MAX_JSLOTS check.
Igor Munkin
imun at tarantool.org
Thu Jun 30 15:08:24 MSK 2022
Sergey,
I've checked the patch into all long-term branches in tarantool/luajit
and bumped a new version in master, 2.10 and 1.10.
On 22.10.21, Sergey Kaplun wrote:
> From: Mike Pall <mike>
>
> Thanks to Yichun Zhang.
>
> (cherry picked from commit 630ff3196a06353c6a7ccd1e9ac3958f4a8ca13c)
>
> Before the patch, JIT compiler doesn't check slots overflow for
> recording of metamethods call. So the assertion in `rec_check_slots()`
> checking that we don't overflow the slots limit (the limit
> `LJ_MAX_JSLOTS` is 250) is failing, when we record metamethod call
> (`J->baseslot` diff + `J->maxslot` ~ 5-8 stack slots), while almost all
> slots of JIT engine are occupied.
>
> This patch adds the corresponding check in `lj_record_call()`.
>
> Sergey Kaplun:
> * added the description and the test for the problem
> ---
>
> Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-fix-slot-check-for-mm-record
> Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-fix-slot-check-for-mm-record
>
> src/lj_record.c | 2 +
> .../fix-slot-check-for-mm-record.test.lua | 81 +++++++++++++++++++
> 2 files changed, 83 insertions(+)
> create mode 100644 test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
>
<snipped>
> --
> 2.31.0
>
--
Best regards,
IM
More information about the Tarantool-patches
mailing list