summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-11-01 22:51:05 (GMT)
committerGitHub <noreply@github.com>2022-11-01 22:51:05 (GMT)
commit9711265182f163ba381e7800e3748ac28710f9ef (patch)
tree8c71b961eff103e00b93bbaeacf108baa86bbf25 /Python
parentc0859743d9ad3bbd4c021200f4162cfeadc0c17a (diff)
downloadcpython-9711265182f163ba381e7800e3748ac28710f9ef.zip
cpython-9711265182f163ba381e7800e3748ac28710f9ef.tar.gz
cpython-9711265182f163ba381e7800e3748ac28710f9ef.tar.bz2
gh-98925: Lower marshal recursion depth for WASI (GH-98938)
For wasmtime 2.0, the stack depth cost is 6% higher. This causes the default max `marshal` recursion depth to blow the stack. As the default marshal depth is 2000 and Windows is set to 1000, split the difference and choose 1500 for WASI to be safe.
Diffstat (limited to 'Python')
-rw-r--r--Python/marshal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 90a4405..2690f55 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -34,6 +34,8 @@ module marshal
*/
#if defined(MS_WINDOWS)
#define MAX_MARSHAL_STACK_DEPTH 1000
+#elif defined(__wasi__)
+#define MAX_MARSHAL_STACK_DEPTH 1500
#else
#define MAX_MARSHAL_STACK_DEPTH 2000
#endif