Skip to content

Commit a0e7fee

Browse files
committed
GH-126910: avoid reading the FP for getting the SP
1 parent a209dd2 commit a0e7fee

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Include/internal/pycore_pystate.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,23 +306,15 @@ _Py_AssertHoldsTstateFunc(const char *func)
306306
#define _Py_AssertHoldsTstate()
307307
#endif
308308

309-
#if !_Py__has_builtin(__builtin_frame_address) && !defined(__GNUC__) && !defined(_MSC_VER)
310309
static uintptr_t return_pointer_as_int(char* p) {
311310
return (uintptr_t)p;
312311
}
313-
#endif
314312

315313
static inline uintptr_t
316314
_Py_get_machine_stack_pointer(void) {
317-
#if _Py__has_builtin(__builtin_frame_address) || defined(__GNUC__)
318-
return (uintptr_t)__builtin_frame_address(0);
319-
#elif defined(_MSC_VER)
320-
return (uintptr_t)_AddressOfReturnAddress();
321-
#else
322315
char here;
323316
/* Avoid compiler warning about returning stack address */
324317
return return_pointer_as_int(&here);
325-
#endif
326318
}
327319

328320
static inline intptr_t

0 commit comments

Comments
 (0)