Skip to content

Commit 56e59a4

Browse files
authored
GH-111807: Lower the parser stack depth under WASI debug builds (#112225)
1 parent ce1096f commit 56e59a4

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lower the max parser stack depth to 1000 under WASI debug builds.

Parser/parser.c

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/peg_generator/pegen/c_generator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
#endif
3939
4040
#ifdef __wasi__
41-
# define MAXSTACK 4000
41+
# ifdef Py_DEBUG
42+
# define MAXSTACK 1000
43+
# else
44+
# define MAXSTACK 4000
45+
# endif
4246
#else
4347
# define MAXSTACK 6000
4448
#endif

0 commit comments

Comments
 (0)