File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -193,29 +193,24 @@ extern void _PyEval_DeactivateOpCache(void);
193193
194194/* --- _Py_EnterRecursiveCall() ----------------------------------------- */
195195
196- #if !_Py__has_builtin (__builtin_frame_address )
196+ #if !_Py__has_builtin (__builtin_frame_address ) && !defined( _MSC_VER )
197197static uintptr_t return_pointer_as_int (char * p ) {
198198 return (uintptr_t )p ;
199199}
200200#endif
201201
202- #ifdef _MSC_VER
203- #pragma warning(push)
204- #pragma warning(disable:4172)
205- #endif
206202static inline uintptr_t
207203_Py_get_machine_stack_pointer (void ) {
208204#if _Py__has_builtin (__builtin_frame_address )
209205 return (uintptr_t )__builtin_frame_address (0 );
206+ #elif defined(_MSC_VER )
207+ return (uintptr_t )_AddressOfReturnAddress ();
210208#else
211209 char here ;
212210 /* Avoid compiler warning about returning stack address */
213211 return return_pointer_as_int (& here );
214212#endif
215213}
216- #ifdef _MSC_VER
217- #pragma warning(pop)
218- #endif
219214
220215static inline int _Py_MakeRecCheck (PyThreadState * tstate ) {
221216 uintptr_t here_addr = _Py_get_machine_stack_pointer ();
You can’t perform that action at this time.
0 commit comments