瀏覽代碼

Add missing LJ_MAX_JSLOTS check.

Thanks to Yichun Zhang.
Mike Pall 8 年之前
父節點
當前提交
630ff3196a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/lj_record.c

+ 2 - 0
src/lj_record.c

@@ -633,6 +633,8 @@ void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs)
   J->framedepth++;
   J->base += func+1;
   J->baseslot += func+1;
+  if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
+    lj_trace_err(J, LJ_TRERR_STACKOV);
 }
 
 /* Record tail call. */