Explorar o código

Limit number of parent links handled by backend.

Mike Pall %!s(int64=13) %!d(string=hai) anos
pai
achega
53e28d7678
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/lj_asm.c

+ 2 - 0
src/lj_asm.c

@@ -1576,6 +1576,8 @@ static void asm_setup_regsp(ASMState *as)
   if (as->parent) {
     uint16_t *p;
     lastir = lj_snap_regspmap(as->parent, as->J->exitno, ir);
+    if (lastir - ir > LJ_MAX_JSLOTS)
+      lj_trace_err(as->J, LJ_TRERR_NYICOAL);
     as->stopins = (IRRef)((lastir-1) - as->ir);
     for (p = as->parentmap; ir < lastir; ir++) {
       RegSP rs = ir->prev;