]> git.eshelyaron.com Git - emacs.git/commitdiff
Stop pretending that specpdl overflow can ever occur
authorMattias Engdegård <mattiase@acm.org>
Thu, 13 Apr 2023 15:25:25 +0000 (17:25 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 13 Apr 2023 15:25:25 +0000 (17:25 +0200)
* src/eval.c (grow_specpdl_allocation): Remove impossible error.
* src/data.c (syms_of_data): Note obsolence of
`excessive-variable-binding`.

src/data.c
src/eval.c

index 8dc5000424ecec28ccee0267b2050f50d229b80c..4ab37e86ce5778ca9104c1137e95c18a909c205e 100644 (file)
@@ -4217,10 +4217,11 @@ syms_of_data (void)
   Fput (Qrecursion_error, Qerror_message, build_pure_c_string
        ("Excessive recursive calling error"));
 
-  PUT_ERROR (Qexcessive_variable_binding, recursion_tail,
-            "Variable binding depth exceeds max-specpdl-size");
   PUT_ERROR (Qexcessive_lisp_nesting, recursion_tail,
             "Lisp nesting exceeds `max-lisp-eval-depth'");
+  /* Error obsolete (from 29.1), kept for compatibility.  */
+  PUT_ERROR (Qexcessive_variable_binding, recursion_tail,
+            "Variable binding depth exceeds max-specpdl-size");
 
   /* Types that type-of returns.  */
   DEFSYM (Qinteger, "integer");
index 1a4d3ad03075201ed4a322160c71863ff7d8849b..545a280ae91bc4088c2ecb4b124c664e98019ca5 100644 (file)
@@ -2373,8 +2373,7 @@ grow_specpdl_allocation (void)
   union specbinding *pdlvec = specpdl - 1;
   ptrdiff_t size = specpdl_end - specpdl;
   ptrdiff_t pdlvecsize = size + 1;
-  if (max_size <= size)
-    xsignal0 (Qexcessive_variable_binding);  /* Can't happen, essentially.  */
+  eassert (max_size > size);
   pdlvec = xpalloc (pdlvec, &pdlvecsize, 1, max_size + 1, sizeof *specpdl);
   specpdl = pdlvec + 1;
   specpdl_end = specpdl + pdlvecsize - 1;