summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2018-06-04 20:25:00 (GMT)
committerGitHub <noreply@github.com>2018-06-04 20:25:00 (GMT)
commit2a4a62ba4ae770bbc7b7fdec0760031c83fe1f7b (patch)
tree733d41607d331ca4401a34ad06908f5549c3aaa1 /Python
parentb609e687a076d77bdd687f5e4def85e29a044bfc (diff)
downloadcpython-2a4a62ba4ae770bbc7b7fdec0760031c83fe1f7b.zip
cpython-2a4a62ba4ae770bbc7b7fdec0760031c83fe1f7b.tar.gz
cpython-2a4a62ba4ae770bbc7b7fdec0760031c83fe1f7b.tar.bz2
bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)
Diffstat (limited to 'Python')
-rw-r--r--Python/marshal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index e23daf6..6d06266 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -25,8 +25,14 @@ module marshal
* 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.
+ *
+ * BUG: https://bugs.python.org/issue33720
+ * On Windows PGO builds, the r_object function overallocates its stack and
+ * can cause a stack overflow. We reduce the maximum depth for all Windows
+ * releases to protect against this.
+ * #if defined(MS_WINDOWS) && defined(_DEBUG)
*/
-#if defined(MS_WINDOWS) && defined(_DEBUG)
+#if defined(MS_WINDOWS)
#define MAX_MARSHAL_STACK_DEPTH 1000
#else
#define MAX_MARSHAL_STACK_DEPTH 2000