mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
GH-130396: Use computed stack limits on linux (GH-130398)
* Implement C recursion protection with limit pointers for Linux, MacOS and Windows * Remove calls to PyOS_CheckStack * Add stack protection to parser * Make tests more robust to low stacks * Improve error messages for stack overflow
This commit is contained in:
parent
99088ab081
commit
014223649c
58 changed files with 1295 additions and 1482 deletions
|
@ -2,7 +2,7 @@ import collections.abc
|
|||
import copy
|
||||
import pickle
|
||||
import unittest
|
||||
from test.support import get_c_recursion_limit, skip_emscripten_stack_overflow
|
||||
from test.support import skip_emscripten_stack_overflow, skip_wasi_stack_overflow, exceeds_recursion_limit
|
||||
|
||||
class DictSetTest(unittest.TestCase):
|
||||
|
||||
|
@ -277,10 +277,11 @@ class DictSetTest(unittest.TestCase):
|
|||
# Again.
|
||||
self.assertIsInstance(r, str)
|
||||
|
||||
@skip_wasi_stack_overflow()
|
||||
@skip_emscripten_stack_overflow()
|
||||
def test_deeply_nested_repr(self):
|
||||
d = {}
|
||||
for i in range(get_c_recursion_limit()//2 + 100):
|
||||
for i in range(exceeds_recursion_limit()):
|
||||
d = {42: d.values()}
|
||||
self.assertRaises(RecursionError, repr, d)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue