push
github
Correct fix for stack check when recording BC_VARG. Reported by Yichun Zhang. (cherry picked from commit b2791179e) This patch is a follow-up to the commit 5f0a43ace ("bugfix: fixed assertion failure "lj_record.c:92: rec_check_slots: Assertion `nslots <= 250' failed" found by stressing our edgelang compiler."), which is identical to the commit e0388e6c0 ("Fix stack check when recording BC_VARG.)" from the upstream. The error is raised too late, when buffer overflow of `J->slot` has already occurred and data in the `jit_State` structure is corrupted. This patch moves the corresponding check before using the `J->slot` buffer. The `J->maxslot` may overflow the buffer only in cases where the amount of the vararg results is unknown. The check is used only in this case since the trace recording for the undefined-on-trace varargs is not yet implemented for an unknown amount of varargs. Sergey Kaplun: * added the description and the test for the problem Part of tarantool/tarantool#9924 Reviewed-by: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Reviewed-by: Sergey Bronnikov <sergeyb@tarantool.org> Signed-off-by: Sergey Kaplun <skaplun@tarantool.org>
5657 of 6018 branches covered (94.0%)
Branch coverage included in aggregate %.
2 of 2 new or added lines in 1 file covered. (100.0%)
16 existing lines in 6 files now uncovered.21581 of 23417 relevant lines covered (92.16%)
2947151.49 hits per line