From: Paul Eggert Date: Tue, 9 Aug 2016 07:37:39 +0000 (-0700) Subject: Remove arbitrary limit on bytecode maxdepth X-Git-Tag: emacs-26.0.90~1766 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cb71a119f7231984e010cc28ef33854721036a0f;p=emacs.git Remove arbitrary limit on bytecode maxdepth * src/bytecode.c (exec_byte_code): Remove MAX_ALLOCA-based limit on bytecode maxdepth, by using SAFE_ALLOCA_LISP instead of alloca. pipeline is fuller. --- diff --git a/src/bytecode.c b/src/bytecode.c index 52f827f282a..0c5b8494d0c 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -413,7 +413,7 @@ Lisp_Object exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args) { - ptrdiff_t count = SPECPDL_INDEX (); + USE_SAFE_ALLOCA; #ifdef BYTE_CODE_METER int volatile this_op = 0; int prev_op; @@ -447,15 +447,15 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, stack.byte_string = bytestr; stack.pc = stack.byte_string_start = SDATA (bytestr); - if (MAX_ALLOCA / word_size <= XFASTINT (maxdepth)) - memory_full (SIZE_MAX); unsigned char quitcounter = 0; - int stack_items = XFASTINT (maxdepth) + 1; - Lisp_Object *stack_base = alloca (stack_items * sizeof *top); + EMACS_INT stack_items = XFASTINT (maxdepth) + 1; + Lisp_Object *stack_base; + SAFE_ALLOCA_LISP (stack_base, stack_items); Lisp_Object *stack_lim = stack_base + stack_items; top = stack_base; stack.next = byte_stack_list; byte_stack_list = &stack; + ptrdiff_t count = SPECPDL_INDEX (); if (!NILP (args_template)) { @@ -1699,6 +1699,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, error ("binding stack not balanced (serious byte compiler bug)"); } + SAFE_FREE (); return result; }