From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Sergey Kaplun <skaplun@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit] Fix string.char() recording with no arguments. Date: Fri, 11 Feb 2022 22:09:26 +0300 [thread overview] Message-ID: <Yga0ZoRRa91TIWq8@tarantool.org> (raw) In-Reply-To: <20210820154846.5515-1-skaplun@tarantool.org> Sergey, I've checked the patch into all long-term branches in tarantool/luajit and bumped a new version in 1.10, 2.8 and master. On 20.08.21, Sergey Kaplun wrote: > From: Mike Pall <mike> > > (cherry picked from commit dfa692b746c9de067857d5fc992a41730be3d99a) > > `string.char()` call without arguments yields an empty string. When JIT > machinery records the aforementioned call it doesn't handle this case. > Each recording fast function expects 1 result by default. Hence, when > return from this call is recorded the framelink slot is used as a > result. It is loaded into the corresponding slot as an IR with `IRT_NUM` > type. It leads to assertion failure in `rec_check_slots()`, when a next > bytecode is recorded, because type of TValue on the stack (`LJ_STR`) > isn't the same as IR (and TRef) type. > > This patch handles the case without arguments by the loading of IR with > empty string reference into the corresponding slot. > > Sergey Kaplun: > * added the description and the test for the problem > > Resolves tarantool/tarantool#6371 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-6371-string-char-no-arg > Issue: https://github.com/tarantool/tarantool/issues/6371 > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-6371-string-char-no-arg > Side note: CI is totally red, but AFAICS it's unrelated with my patch. > Side note: See also Changelog at the Tarantool branch. > > src/lj_ffrecord.c | 2 ++ > .../gh-6371-string-char-no-arg.test.lua | 28 +++++++++++++++++++ > 2 files changed, 30 insertions(+) > create mode 100644 test/tarantool-tests/gh-6371-string-char-no-arg.test.lua > <snipped> > -- > 2.31.0 > -- Best regards, IM
prev parent reply other threads:[~2022-02-11 19:13 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-20 15:48 Sergey Kaplun via Tarantool-patches 2021-08-31 11:39 ` Sergey Ostanevich via Tarantool-patches 2021-09-01 7:10 ` Sergey Kaplun via Tarantool-patches 2022-01-10 11:48 ` sergos via Tarantool-patches 2022-01-27 21:46 ` Igor Munkin via Tarantool-patches 2022-01-27 22:02 ` Igor Munkin via Tarantool-patches 2022-01-28 8:26 ` Sergey Kaplun via Tarantool-patches 2022-01-28 12:49 ` Sergey Kaplun via Tarantool-patches 2022-01-28 13:19 ` Igor Munkin via Tarantool-patches 2022-01-28 15:12 ` Sergey Kaplun via Tarantool-patches 2022-02-11 19:09 ` Igor Munkin via Tarantool-patches [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=Yga0ZoRRa91TIWq8@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=imun@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit] Fix string.char() recording with no arguments.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox