]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-111807: Lower the parser stack depth under WASI debug builds (#112225)
authorBrett Cannon <brett@python.org>
Mon, 20 Nov 2023 13:27:33 +0000 (05:27 -0800)
committerGitHub <noreply@github.com>
Mon, 20 Nov 2023 13:27:33 +0000 (13:27 +0000)
Misc/NEWS.d/next/Core and Builtins/2023-11-17-16-49-32.gh-issue-111807.QvjP9_.rst [new file with mode: 0644]
Parser/parser.c
Tools/peg_generator/pegen/c_generator.py

diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-11-17-16-49-32.gh-issue-111807.QvjP9_.rst b/Misc/NEWS.d/next/Core and Builtins/2023-11-17-16-49-32.gh-issue-111807.QvjP9_.rst
new file mode 100644 (file)
index 0000000..6f07584
--- /dev/null
@@ -0,0 +1 @@
+Lower the max parser stack depth to 1000 under WASI debug builds.
index ca8e9d0e23661cec497eac87bb5e84d9a1a5d2f5..d27ddd3d3e3835d6645d939f2c495ed4c72dcc8c 100644 (file)
@@ -8,7 +8,11 @@
 #endif
 
 #ifdef __wasi__
-#  define MAXSTACK 4000
+#  ifdef Py_DEBUG
+#    define MAXSTACK 1000
+#  else
+#    define MAXSTACK 4000
+#  endif
 #else
 #  define MAXSTACK 6000
 #endif
index 301949bdae96fec927d39f8374c5745a384e2e70..7cdd5debe9a225fe9a7ba8aba00a0b06fef2f8ff 100644 (file)
@@ -38,7 +38,11 @@ EXTENSION_PREFIX = """\
 #endif
 
 #ifdef __wasi__
-#  define MAXSTACK 4000
+#  ifdef Py_DEBUG
+#    define MAXSTACK 1000
+#  else
+#    define MAXSTACK 4000
+#  endif
 #else
 #  define MAXSTACK 6000
 #endif