Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63175a1

Browse files
committed
[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.
1 parent f7f3deb commit 63175a1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Python/marshal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
/* High water mark to determine when the marshalled object is dangerously deep
1515
* and risks coring the interpreter. When the object stack gets this deep,
1616
* raise an exception instead of continuing.
17+
* On Windows debug builds, reduce this value.
1718
*/
19+
#if defined(MS_WINDOWS) && defined(_DEBUG)
20+
#define MAX_MARSHAL_STACK_DEPTH 1500
21+
#else
1822
#define MAX_MARSHAL_STACK_DEPTH 2000
23+
#endif
1924

2025
#define TYPE_NULL '0'
2126
#define TYPE_NONE 'N'

0 commit comments

Comments
 (0)