Skip to content

Commit

Permalink
fix(luajit2): iterate over non-empty table got empty on OpenResty 1.2…
Browse files Browse the repository at this point in the history
…1.4.1
  • Loading branch information
ADD-SP authored and hutchic committed Oct 25, 2022
1 parent 8374d25 commit 53976a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions openresty-patches/patches/1.21.4.1/LuaJIT-2.1-20220411_02.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From dad04f1754723e76ba9dcf9f401f3134a0cd3972 Mon Sep 17 00:00:00 2001
From: Mike Pall <mike>
Date: Wed, 14 Sep 2022 12:26:53 +0200
Subject: [PATCH] Fix trace join to BC_JLOOP originating from BC_ITERN.

Reported by OpenResty Inc.
---
src/lj_record.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/LuaJIT-2.1-20220411/src/lj_record.c b/LuaJIT-2.1-20220411/src/lj_record.c
index 5d02d24a1..bfd412365 100644
--- a/LuaJIT-2.1-20220411/src/lj_record.c
+++ b/LuaJIT-2.1-20220411/src/lj_record.c
@@ -2572,7 +2572,8 @@ void lj_record_ins(jit_State *J)
break;
case BC_JLOOP:
rec_loop_jit(J, rc, rec_loop(J, ra,
- !bc_isret(bc_op(traceref(J, rc)->startins))));
+ !bc_isret(bc_op(traceref(J, rc)->startins)) &&
+ bc_op(traceref(J, rc)->startins) != BC_ITERN));
break;

case BC_IFORL:

0 comments on commit 53976a8

Please sign in to comment.