Blame SOURCES/0052-Actually-implement-maxirconst-trace-limit.patch

006bc1
From 0a9ff94c4a1fcec2c310dcb092da694f23186e23 Mon Sep 17 00:00:00 2001
006bc1
From: Mike Pall <mike>
006bc1
Date: Sun, 14 Oct 2018 15:21:37 +0200
006bc1
Subject: [PATCH 52/72] Actually implement maxirconst trace limit.
006bc1
006bc1
Suggested by spacewander.
006bc1
---
006bc1
 src/lj_record.c | 5 +++--
006bc1
 1 file changed, 3 insertions(+), 2 deletions(-)
006bc1
006bc1
diff --git a/src/lj_record.c b/src/lj_record.c
006bc1
index 1a2b1c5..7f37d6c 100644
006bc1
--- a/src/lj_record.c
006bc1
+++ b/src/lj_record.c
006bc1
@@ -2470,8 +2470,9 @@ void lj_record_ins(jit_State *J)
006bc1
 #undef rbv
006bc1
 #undef rcv
006bc1
 
006bc1
-  /* Limit the number of recorded IR instructions. */
006bc1
-  if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord])
006bc1
+  /* Limit the number of recorded IR instructions and constants. */
006bc1
+  if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord] ||
006bc1
+      J->cur.nk < REF_BIAS-(IRRef)J->param[JIT_P_maxirconst])
006bc1
     lj_trace_err(J, LJ_TRERR_TRACEOV);
006bc1
 }
006bc1
 
006bc1
-- 
006bc1
2.20.1
006bc1