summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-07-06 23:37:02 -0700
committerBenjamin Peterson <benjamin@python.org>2016-07-06 23:37:02 -0700
commit64c82753de70f312c80797f63b6b8b98232b6f0f (patch)
tree0253098623eeb44e0e417d126bd3da183400b5f9 /Python/marshal.c
parentee69451f344847858919bacf00a087c77f381264 (diff)
downloadcpython-git-64c82753de70f312c80797f63b6b8b98232b6f0f.tar.gz
reduce marshal stack size in debug mode on windows (closes #27019)
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 6b285aaa41..e1a84d0bf7 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -16,8 +16,13 @@
/* High water mark to determine when the marshalled object is dangerously deep
* and risks coring the interpreter. When the object stack gets this deep,
* raise an exception instead of continuing.
+ * On Windows debug builds, reduce this value.
*/
+#if defined(MS_WINDOWS) && defined(_DEBUG)
+#define MAX_MARSHAL_STACK_DEPTH 1000
+#else
#define MAX_MARSHAL_STACK_DEPTH 2000
+#endif
#define TYPE_NULL '0'
#define TYPE_NONE 'N'