texlive[57960] Build/source/texk/web2c/luatexdir: luatex: sync with

commits+kakuto at tug.org commits+kakuto at tug.org
Sat Feb 27 00:31:30 CET 2021


Revision: 57960
          http://tug.org/svn/texlive?view=revision&revision=57960
Author:   kakuto
Date:     2021-02-27 00:31:30 +0100 (Sat, 27 Feb 2021)
Log Message:
-----------
luatex: sync with the upstream

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
    trunk/Build/source/texk/web2c/luatexdir/tex/scanning.c

Modified: trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2021-02-26 23:08:02 UTC (rev 57959)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2021-02-26 23:31:30 UTC (rev 57960)
@@ -1 +1 @@
-#define luatex_svn_revision 7410
+#define luatex_svn_revision 7411

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/scanning.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/scanning.c	2021-02-26 23:08:02 UTC (rev 57959)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/scanning.c	2021-02-26 23:31:30 UTC (rev 57960)
@@ -19,6 +19,8 @@
 
 #include "ptexlib.h"
 
+static int nesting = 0;
+# define max_nesting 1000
 static void scan_expr(void);
 
 /*tex
@@ -2519,7 +2521,17 @@
     a = arith_error;
     b = false;
     p = null;
-    /*tex Scan and evaluate an expression |e| of type |l|. */
+    /*tex 
+     
+         Scan and evaluate an expression |e| of type |l|. 
+         To avoid an infinite recursion we set|max_nesting| as upper limit. 
+         This limit is unrelated to the expansion limit |expand_depth| and it cannot be modify at compile time.
+
+     */
+    nesting++;
+    if (nesting > max_nesting) {
+        formatted_error("tex", "\\*expr can only be nested %d deep",max_nesting);
+    }
   RESTART:
     r = expr_none;
     e = 0;
@@ -2748,4 +2760,5 @@
     arith_error = a;
     cur_val = e;
     cur_val_level = l;
+    nesting--;
 }



More information about the tex-live-commits mailing list.