summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-02-26 23:31:30 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-02-26 23:31:30 +0000
commit32e7e15b29663df6034ac21916c1fd19362a3d58 (patch)
tree442e45306c485e31d7c6da97da547b9cd45ca0b8 /Build
parentf4179201871ed545b48f97cd2bf87497f44a7ca2 (diff)
luatex: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@57960 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex_svnversion.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/scanning.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
index dd8dc72f0ae..59a54e0f6f6 100644
--- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1 +1 @@
-#define luatex_svn_revision 7410
+#define luatex_svn_revision 7411
diff --git a/Build/source/texk/web2c/luatexdir/tex/scanning.c b/Build/source/texk/web2c/luatexdir/tex/scanning.c
index deddbf5649b..f3313f065b5 100644
--- a/Build/source/texk/web2c/luatexdir/tex/scanning.c
+++ b/Build/source/texk/web2c/luatexdir/tex/scanning.c
@@ -19,6 +19,8 @@ LuaTeX; if not, see <http://www.gnu.org/licenses/>.
#include "ptexlib.h"
+static int nesting = 0;
+# define max_nesting 1000
static void scan_expr(void);
/*tex
@@ -2519,7 +2521,17 @@ static void scan_expr(void)
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 @@ static void scan_expr(void)
arith_error = a;
cur_val = e;
cur_val_level = l;
+ nesting--;
}