mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
GH-131288: Use _AddressOfReturnAddress for MSVC in pycore_ceval.h (gh-131289)
Use `_AddressOfReturnAddress` in `_Py_get_machine_stack_pointer` to silence MSVC warning in pycore_ceval.h for release builds.
This commit is contained in:
parent
37d47d4965
commit
20098719df
1 changed files with 3 additions and 1 deletions
|
|
@ -196,7 +196,7 @@ extern void _PyEval_DeactivateOpCache(void);
|
|||
|
||||
/* --- _Py_EnterRecursiveCall() ----------------------------------------- */
|
||||
|
||||
#if !_Py__has_builtin(__builtin_frame_address)
|
||||
#if !_Py__has_builtin(__builtin_frame_address) && !defined(_MSC_VER)
|
||||
static uintptr_t return_pointer_as_int(char* p) {
|
||||
return (uintptr_t)p;
|
||||
}
|
||||
|
|
@ -206,6 +206,8 @@ static inline uintptr_t
|
|||
_Py_get_machine_stack_pointer(void) {
|
||||
#if _Py__has_builtin(__builtin_frame_address)
|
||||
return (uintptr_t)__builtin_frame_address(0);
|
||||
#elif defined(_MSC_VER)
|
||||
return (uintptr_t)_AddressOfReturnAddress();
|
||||
#else
|
||||
char here;
|
||||
/* Avoid compiler warning about returning stack address */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue