mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
GH-139914: Handle stack growth direction on HPPA (GH-140028)
Adapted from a patch for Python 3.14 submitted to the Debian BTS by John https://bugs.debian.org/1105111#20 Co-authored-by: John David Anglin <dave.anglin@bell.net>
This commit is contained in:
parent
336366fd7c
commit
f6dd9c12a8
10 changed files with 94 additions and 5 deletions
|
|
@ -1048,9 +1048,14 @@ def get_sp():
|
|||
|
||||
this_sp = _testinternalcapi.get_stack_pointer()
|
||||
lower_sp = _testcapi.pyobject_vectorcall(get_sp, (), ())
|
||||
self.assertLess(lower_sp, this_sp)
|
||||
if _testcapi._Py_STACK_GROWS_DOWN:
|
||||
self.assertLess(lower_sp, this_sp)
|
||||
safe_margin = this_sp - lower_sp
|
||||
else:
|
||||
self.assertGreater(lower_sp, this_sp)
|
||||
safe_margin = lower_sp - this_sp
|
||||
# Add an (arbitrary) extra 25% for safety
|
||||
safe_margin = (this_sp - lower_sp) * 5 / 4
|
||||
safe_margin = safe_margin * 5 / 4
|
||||
self.assertLess(safe_margin, _testinternalcapi.get_stack_margin())
|
||||
|
||||
@skip_on_s390x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue