[Tarantool-patches] [PATCH luajit] Fix bytecode dump unpatching.

Igor Munkin imun at tarantool.org
Thu Jun 30 15:10:03 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 27.01.22, Sergey Kaplun wrote:
> From: Mike Pall <mike>
> 
> Reported by Christopher Oliver.
> 
> (cherry picked from commit 20ac817a747cf8cab044ae81b09c08d23e34342b)
> 
> When a compiled function with up-recursion RET bytecodes are patched to
> JLOOP bytecode. During dump of those bytecodes they should be unpatched
> to the original one. It is done by restoring the opcode by subtraction
> the diff between JLOOP and ILOOP bytecodes. That gives the LOOP
> bytecodes instead RET as expected.
> 
> This patch fixes the bytecode unpatching via copy the original start
> instruction, that was patched.
> 
> Sergey Kaplun:
> * added the description and the test for the problem
> 
> Part of tarantool/tarantool#6548
> ---
> 
> Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-wrong-bc-ret
> Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-wrong-bc-ret-full-ci
> Related issue: https://github.com/tarantool/tarantool/issues/6548
> 
>  src/lj_bcwrite.c                              |  5 +----
>  .../bc-jit-unpatching.test.lua                | 22 +++++++++++++++++++
>  2 files changed, 23 insertions(+), 4 deletions(-)
>  create mode 100644 test/tarantool-tests/bc-jit-unpatching.test.lua
> 

<snipped>

> -- 
> 2.34.1
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list