We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_AddressOfReturnAddress
1 parent 37d47d4 commit 2009871Copy full SHA for 2009871
Include/internal/pycore_ceval.h
@@ -196,7 +196,7 @@ extern void _PyEval_DeactivateOpCache(void);
196
197
/* --- _Py_EnterRecursiveCall() ----------------------------------------- */
198
199
-#if !_Py__has_builtin(__builtin_frame_address)
+#if !_Py__has_builtin(__builtin_frame_address) && !defined(_MSC_VER)
200
static uintptr_t return_pointer_as_int(char* p) {
201
return (uintptr_t)p;
202
}
@@ -206,6 +206,8 @@ static inline uintptr_t
206
_Py_get_machine_stack_pointer(void) {
207
#if _Py__has_builtin(__builtin_frame_address)
208
return (uintptr_t)__builtin_frame_address(0);
209
+#elif defined(_MSC_VER)
210
+ return (uintptr_t)_AddressOfReturnAddress();
211
#else
212
char here;
213
/* Avoid compiler warning about returning stack address */
0 commit comments