Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
64c82753
Commit
64c82753
authored
Jul 06, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce marshal stack size in debug mode on windows (closes #27019)
parent
ee69451f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
Lib/test/test_marshal.py
Lib/test/test_marshal.py
+4
-1
Python/marshal.c
Python/marshal.c
+5
-0
No files found.
Lib/test/test_marshal.py
View file @
64c82753
...
...
@@ -234,7 +234,10 @@ class BugsTestCase(unittest.TestCase):
# Create a deeply nested structure.
head
=
last
=
[]
# The max stack depth should match the value in Python/marshal.c.
MAX_MARSHAL_STACK_DEPTH
=
2000
if
os
.
name
==
'nt'
and
hasattr
(
sys
,
'gettotalrefcount'
):
MAX_MARSHAL_STACK_DEPTH
=
1000
else
:
MAX_MARSHAL_STACK_DEPTH
=
2000
for
i
in
range
(
MAX_MARSHAL_STACK_DEPTH
-
2
):
last
.
append
([
0
])
last
=
last
[
-
1
]
...
...
Python/marshal.c
View file @
64c82753
...
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment