summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-29 20:39:13 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-29 20:39:13 (GMT)
commit63175a1330102b99ffe4c0635ca54aa79d4be1e3 (patch)
treeed62d6e226d30086b9d1cd2ffe504b202c09f388 /Python/marshal.c
parentf7f3deb7025fadfae5f074bc0f918852e39ad2d9 (diff)
downloadcpython-63175a1330102b99ffe4c0635ca54aa79d4be1e3.zip
cpython-63175a1330102b99ffe4c0635ca54aa79d4be1e3.tar.gz
cpython-63175a1330102b99ffe4c0635ca54aa79d4be1e3.tar.bz2
[Oops, I forgot half of the patch.]
Patch # 1050 by Amaury Forgeot d'Arc. On Windows, debug builds insert stack probes, and recursive functions tend to exhaust the stack faster. This patch reduces the marshal maximum depth from 2000 to 1500 for debug builds only. Optimized builds are not affected. This allows test_marshal to pass with debug builds.
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 c5952b2..1ec33bd 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -14,8 +14,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 1500
+#else
#define MAX_MARSHAL_STACK_DEPTH 2000
+#endif
#define TYPE_NULL '0'
#define TYPE_NONE 'N'