@@ -1508,7 +1508,7 @@ dummy_func(
15081508
15091509 inst (LOAD_BUILD_CLASS , ( -- bc )) {
15101510 int err ;
1511- PyObject * bc_o = PyMapping_GetOptionalItem2 (BUILTINS (), & _Py_ID (__build_class__ ), & err );
1511+ PyObject * bc_o = _PyMapping_GetOptionalItem2 (BUILTINS (), & _Py_ID (__build_class__ ), & err );
15121512 ERROR_IF (err < 0 );
15131513 if (bc_o == NULL ) {
15141514 _PyErr_SetString (tstate , PyExc_NameError ,
@@ -1712,7 +1712,7 @@ dummy_func(
17121712 inst (LOAD_FROM_DICT_OR_GLOBALS , (mod_or_class_dict -- v )) {
17131713 PyObject * name = GETITEM (FRAME_CO_NAMES , oparg );
17141714 int err ;
1715- PyObject * v_o = PyMapping_GetOptionalItem2 (PyStackRef_AsPyObjectBorrow (mod_or_class_dict ), name , & err );
1715+ PyObject * v_o = _PyMapping_GetOptionalItem2 (PyStackRef_AsPyObjectBorrow (mod_or_class_dict ), name , & err );
17161716
17171717 PyStackRef_CLOSE (mod_or_class_dict );
17181718 ERROR_IF (err < 0 );
@@ -1736,11 +1736,11 @@ dummy_func(
17361736 else {
17371737 /* Slow-path if globals or builtins is not a dict */
17381738 /* namespace 1: globals */
1739- v_o = PyMapping_GetOptionalItem2 (GLOBALS (), name , & err );
1739+ v_o = _PyMapping_GetOptionalItem2 (GLOBALS (), name , & err );
17401740 ERROR_IF (err < 0 );
17411741 if (v_o == NULL ) {
17421742 /* namespace 2: builtins */
1743- v_o = PyMapping_GetOptionalItem2 (BUILTINS (), name , & err );
1743+ v_o = _PyMapping_GetOptionalItem2 (BUILTINS (), name , & err );
17441744 ERROR_IF (err < 0 );
17451745 if (v_o == NULL ) {
17461746 _PyEval_FormatExcCheckArg (
@@ -1906,7 +1906,7 @@ dummy_func(
19061906 assert (oparg >= 0 && oparg < _PyFrame_GetCode (frame )-> co_nlocalsplus );
19071907 name = PyTuple_GET_ITEM (_PyFrame_GetCode (frame )-> co_localsplusnames , oparg );
19081908 int err ;
1909- PyObject * value_o = PyMapping_GetOptionalItem2 (class_dict , name , & err );
1909+ PyObject * value_o = _PyMapping_GetOptionalItem2 (class_dict , name , & err );
19101910 if (err < 0 ) {
19111911 ERROR_NO_POP ();
19121912 }
@@ -2082,7 +2082,7 @@ dummy_func(
20822082 }
20832083 /* check if __annotations__ in locals()... */
20842084 int err ;
2085- PyObject * ann_dict = PyMapping_GetOptionalItem2 (LOCALS (), & _Py_ID (__annotations__ ), & err );
2085+ PyObject * ann_dict = _PyMapping_GetOptionalItem2 (LOCALS (), & _Py_ID (__annotations__ ), & err );
20862086 ERROR_IF (err < 0 );
20872087 if (ann_dict == NULL ) {
20882088 ann_dict = PyDict_New ();
@@ -2188,6 +2188,7 @@ dummy_func(
21882188 // handle any case whose performance we care about
21892189 PyObject * super ;
21902190 {
2191+ // scope to tell MSVC that stack is not escaping
21912192 PyObject * stack [] = {class , self };
21922193 super = PyObject_Vectorcall (global_super , stack , oparg & 2 , NULL );
21932194 }
@@ -2251,6 +2252,7 @@ dummy_func(
22512252 int method_found = 0 ;
22522253 PyObject * attr_o ;
22532254 {
2255+ // scope to tell MSVC that method_found_ptr is not escaping
22542256 int * method_found_ptr = & method_found ;
22552257 attr_o = _PySuper_Lookup (cls , self , name ,
22562258 Py_TYPE (self )-> tp_getattro == PyObject_GenericGetAttr ? method_found_ptr : NULL );
@@ -3482,6 +3484,7 @@ dummy_func(
34823484 (void )lasti ; // Shut up compiler warning if asserts are off
34833485 PyObject * res_o ;
34843486 {
3487+ // scope to tell MSVC that stack is not escaping
34853488 PyObject * stack [5 ] = {NULL , PyStackRef_AsPyObjectBorrow (exit_self ), exc , val_o , tb };
34863489 int has_self = !PyStackRef_IsNull (exit_self );
34873490 res_o = PyObject_Vectorcall (exit_func_o , stack + 2 - has_self ,
0 commit comments