[Tarantool-patches] [PATCH luajit] LJ_GC64: Fix IR_VARG offset for fixed number of results.

Igor Munkin imun at tarantool.org
Wed Aug 10 17:32:29 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 13.07.22, Sergey Kaplun wrote:
> From: Mike Pall <mike>
> 
> Reported by George Vaintrub. Fixed by Sergey Kaplun.
> 
> (cherry picked from commit 6bda30d8c745b3963ba870221b9be6acdffed9b1)
> 
> This bug occurs when recording `BC_VARG` with the following conditions:
> 1) varargs undefined on trace.
> 2) known fixed number of results.
> 
> For this case the vararg slots loads via `IR_VLOAD` by offset from
> vararg base. In GC64 mode this offset was miscounting due to missing
> `LJ_FR2` correction in the base TRef calculation. As the result the
> wrong (+1) vararg slot is used.
> 
> This patch adds the missing the aforementioned `LJ_FR2` correction.
> 
> Sergey Kaplun:
> * added the description and the test for the problem
> 
> Resolves tarantool/tarantool#7172
> Part of tarantool/tarantool#7230
> ---
> 
> Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-864-varg-rec-base-offset-full-ci
> Issues:
> * https://github.com/tarantool/tarantool/issues/7172
> * https://github.com/LuaJIT/LuaJIT/issues/864
> 
>  src/lj_record.c                               |  2 +-
>  .../lj-864-varg-rec-base-offset.test.lua      | 25 +++++++++++++++++++
>  2 files changed, 26 insertions(+), 1 deletion(-)
>  create mode 100644 test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
> 

<snipped>

> -- 
> 2.34.1
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list