[Tarantool-patches] [PATCH luajit] Fix IR_BUFPUT assembly.

Igor Munkin imun at tarantool.org
Thu Jul 22 10:51:58 MSK 2021


Sergey,

I've checked the patch into all long-term branches in tarantool/luajit
and bumped a new version in 1.10, 2.7, 2.8 and master.

On 12.07.21, Sergey Kaplun wrote:
> From: Mike Pall <mike>
> 
> Thanks to Peter Cawley.
> 
> (cherry picked from commit 58d0dde0a2df49abc991decbabff15230010829a)
> 
> When recording IR_BUFPTR special variable holds -1 value to mark that
> argument to store is not a single character. If it is, then it can be
> stored in a register directly. When storing a single character we store
> it in the aforementioned variable first to reset the -1 value. But when
> the system has signed characters, and the character to store equals
> \255, the check that the variable still holds -1 value becomes false
> positive and either wrong value is stored or the LuaJIT crashes.
> 
> This patch changes the flag value to -129 to avoid intersections with
> any `char` values.
> 
> Sergey Kaplun:
> * added the description and the test for the problem
> ---
> 
> The patch fixes the problem described in TNT-142.
> 
> Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/lj-375-fix-ir-bufput
> Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-375-fix-ir-bufput
> Issue: https://github.com/LuaJIT/LuaJIT/issues/375
> 
>  src/lj_asm.c                                    |  6 +++---
>  .../lj-375-ir-bufput-signed-char.test.lua       | 17 +++++++++++++++++
>  2 files changed, 20 insertions(+), 3 deletions(-)
>  create mode 100644 test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
> 

<snipped>

> -- 
> 2.31.0
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list