瀏覽代碼

Actually implement maxirconst trace limit.

Suggested by spacewander.
Mike Pall 7 年之前
父節點
當前提交
0a9ff94c4a
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/lj_record.c

+ 3 - 2
src/lj_record.c

@@ -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);
 }