Skip to content

Commit f6002e5

Browse files
committed
Incorporate feedback from review and buildbots
1 parent 12f9ce7 commit f6002e5

File tree

6 files changed

+8
-3
lines changed

6 files changed

+8
-3
lines changed

Include/internal/pycore_ceval.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ extern void _PyEval_DeactivateOpCache(void);
195195

196196
static inline uintptr_t
197197
_Py_get_machine_stack_pointer(void) {
198-
#if defined(__GNUC__) || defined(__clang__)
198+
#if _Py__has_builtin(__builtin_frame_address)
199199
return (uintptr_t)__builtin_frame_address(0);
200200
#else
201201
char here;

Lib/test/test_builtin.py

+1
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ def test_filter_pickle(self):
10551055
f2 = filter(filter_char, "abcdeabcde")
10561056
self.check_iter_pickle(f1, list(f2), proto)
10571057

1058+
@support.skip_wasi_stack_overflow()
10581059
@support.requires_resource('cpu')
10591060
def test_filter_dealloc(self):
10601061
# Tests recursive deallocation of nested filter objects using the

Lib/test/test_call.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
from test.support import (cpython_only, is_wasi, requires_limited_api, Py_DEBUG,
3-
set_recursion_limit, skip_on_s390x, exceeds_recursion_limit, skip_emscripten_stack_overflow,
3+
set_recursion_limit, skip_on_s390x, exceeds_recursion_limit, skip_emscripten_stack_overflow, skip_wasi_stack_overflow,
44
skip_if_sanitizer, import_helper)
55
try:
66
import _testcapi
@@ -1040,6 +1040,7 @@ class TestRecursion(unittest.TestCase):
10401040
@skip_if_sanitizer("requires deep stack", thread=True)
10411041
@unittest.skipIf(_testcapi is None, "requires _testcapi")
10421042
@skip_emscripten_stack_overflow()
1043+
@skip_wasi_stack_overflow()
10431044
def test_super_deep(self):
10441045

10451046
def recurse(n):

Lib/test/test_descr.py

+1
Original file line numberDiff line numberDiff line change
@@ -4519,6 +4519,7 @@ class Oops(object):
45194519
o.whatever = Provoker(o)
45204520
del o
45214521

4522+
@support.skip_wasi_stack_overflow()
45224523
@support.requires_resource('cpu')
45234524
def test_wrapper_segfault(self):
45244525
# SF 927248: deeply nested wrappers could cause stack overflow

Lib/test/test_exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ def g():
13911391
self.assertIsInstance(exc, RecursionError, type(exc))
13921392
self.assertIn("maximum recursion depth exceeded", str(exc))
13931393

1394-
1394+
@support.skip_wasi_stack_overflow()
13951395
@cpython_only
13961396
@support.requires_resource('cpu')
13971397
def test_trashcan_recursion(self):

Python/ceval.c

+2
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,10 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
372372
_tstate->c_stack_top = base + stack_size;
373373
_tstate->c_stack_soft_limit = base + PYOS_STACK_MARGIN_BYTES * 2;
374374
_tstate->c_stack_hard_limit = base + PYOS_STACK_MARGIN_BYTES;
375+
#ifndef _AIX
375376
assert(_tstate->c_stack_soft_limit < here_addr);
376377
assert(here_addr < _tstate->c_stack_top);
378+
#endif
377379
return;
378380
}
379381
# endif

0 commit comments

Comments
 (0)