* [tarantool-patches] [PATCH] luajit: fold machinery misbehaves
@ 2019-07-30 19:59 sergos
2019-08-15 11:29 ` [tarantool-patches] " Kirill Yukhin
0 siblings, 1 reply; 3+ messages in thread
From: sergos @ 2019-07-30 19:59 UTC (permalink / raw)
To: tarantool-patches; +Cc: Sergey Ostanevich
From: Sergey Ostanevich <sergos@tarantool.org>
This is a solution from the reference LuaJIT for
https://github.com/LuaJIT/LuaJIT/issues/505
Picking up ahead of reference repo since it's abandoned
resolves: #4376
available at: https://github.com/tarantool/luajit/tree/sergos/luajit-gh-505-folder-problems-v2
---
src/lj_ffrecord.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c
index dfdee2d..632b8f2 100644
--- a/src/lj_ffrecord.c
+++ b/src/lj_ffrecord.c
@@ -949,8 +949,9 @@ static void LJ_FASTCALL recff_string_find(jit_State *J, RecordFFData *rd)
str->len-(MSize)start, pat->len)) {
TRef pos;
emitir(IRTG(IR_NE, IRT_PGC), tr, trp0);
- pos = emitir(IRTI(IR_SUB), tr, emitir(IRT(IR_STRREF, IRT_PGC), trstr, tr0));
- J->base[0] = emitir(IRTI(IR_ADD), pos, lj_ir_kint(J, 1));
+ /* Caveat: can't use STRREF trstr 0 here because that might be pointing into a wrong string due to folding. */
+ pos = emitir(IRTI(IR_SUB), tr, trsptr);
+ J->base[0] = emitir(IRTI(IR_ADD), pos, emitir(IRTI(IR_ADD), trstart, lj_ir_kint(J, 1)));
J->base[1] = emitir(IRTI(IR_ADD), pos, trplen);
rd->nres = 2;
} else {
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tarantool-patches] Re: [PATCH] luajit: fold machinery misbehaves
2019-07-30 19:59 [tarantool-patches] [PATCH] luajit: fold machinery misbehaves sergos
@ 2019-08-15 11:29 ` Kirill Yukhin
0 siblings, 0 replies; 3+ messages in thread
From: Kirill Yukhin @ 2019-08-15 11:29 UTC (permalink / raw)
To: tarantool-patches; +Cc: Sergey Ostanevich
Hello,
On 30 Jul 19:59, sergos@tarantool.org wrote:
> From: Sergey Ostanevich <sergos@tarantool.org>
>
> This is a solution from the reference LuaJIT for
> https://github.com/LuaJIT/LuaJIT/issues/505
> Picking up ahead of reference repo since it's abandoned
>
> resolves: #4376
>
> available at: https://github.com/tarantool/luajit/tree/sergos/luajit-gh-505-folder-problems-v2
I've checked your patch into 1.10, 2.1, 2.2 and master.
--
Regards, Kirill Yukhin
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tarantool-patches] [PATCH] luajit: fold machinery misbehaves
@ 2019-07-25 12:05 sergos
0 siblings, 0 replies; 3+ messages in thread
From: sergos @ 2019-07-25 12:05 UTC (permalink / raw)
To: tarantool-patches
This is a temporary solution for
https://github.com/LuaJIT/LuaJIT/issues/505
Follow-up: #4376
---
src/lj_opt_fold.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
index acbf36a..e326aff 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -505,6 +505,11 @@ LJFOLDF(kfold_strref_snew)
{
PHIBARRIER(fleft);
if (irref_isk(fins->op2) && fright->i == 0) {
+ /*
+ ** Temporary stub for LuaJIT bug #505 https://github.com/LuaJIT/LuaJIT/issues/505
+ ** Follow-up tracker is #4376
+ */
+ return NEXTFOLD;
return fleft->op1; /* strref(snew(ptr, len), 0) ==> ptr */
} else {
/* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-15 11:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 19:59 [tarantool-patches] [PATCH] luajit: fold machinery misbehaves sergos
2019-08-15 11:29 ` [tarantool-patches] " Kirill Yukhin
-- strict thread matches above, loose matches on Subject: below --
2019-07-25 12:05 [tarantool-patches] " sergos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox