]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Actually implement maxirconst trace limit.
authorMike Pall <mike>
Sun, 14 Oct 2018 13:21:37 +0000 (15:21 +0200)
committerMike Pall <mike>
Sun, 14 Oct 2018 13:21:37 +0000 (15:21 +0200)
Suggested by spacewander.

src/lj_record.c

index 1a2b1c5d5bf430e196670e24401f7d9ed6854836..7f37d6c646008a536a96377317b1e524467c7684 100644 (file)
@@ -2470,8 +2470,9 @@ void lj_record_ins(jit_State *J)
 #undef rbv
 #undef rcv
 
-  /* Limit the number of recorded IR instructions. */
-  if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord])
+  /* Limit the number of recorded IR instructions and constants. */
+  if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord] ||
+      J->cur.nk < REF_BIAS-(IRRef)J->param[JIT_P_maxirconst])
     lj_trace_err(J, LJ_TRERR_TRACEOV);
 }