@@ -1922,9 +1922,10 @@ dummy_func(
19221922 DECREF_INPUTS ();
19231923 ERROR_IF (super == NULL , error );
19241924 PyObject * name = GETITEM (FRAME_CO_NAMES , oparg >> 2 );
1925- attr = PyStackRef_FromPyObjectSteal ( PyObject_GetAttr (super , name ) );
1925+ PyObject * attr_o = PyObject_GetAttr (super , name );
19261926 Py_DECREF (super );
1927- ERROR_IF (PyStackRef_IsNull (attr ), error );
1927+ ERROR_IF (attr_o == NULL , error );
1928+ attr = PyStackRef_FromPyObjectSteal (attr_o );
19281929 null = PyStackRef_NULL ;
19291930 }
19301931
@@ -2740,9 +2741,10 @@ dummy_func(
27402741
27412742 inst (GET_ITER , (iterable -- iter )) {
27422743 /* before: [obj]; after [getiter(obj)] */
2743- iter = PyStackRef_FromPyObjectSteal ( PyObject_GetIter (PyStackRef_AsPyObjectBorrow (iterable ) ));
2744+ PyObject * iter_o = PyObject_GetIter (PyStackRef_AsPyObjectBorrow (iterable ));
27442745 DECREF_INPUTS ();
2745- ERROR_IF (PyStackRef_IsNull (iter ), error );
2746+ ERROR_IF (iter_o == NULL , error );
2747+ iter = PyStackRef_FromPyObjectSteal (iter_o );
27462748 }
27472749
27482750 inst (GET_YIELD_FROM_ITER , (iterable -- iter )) {
@@ -3052,16 +3054,18 @@ dummy_func(
30523054 PyObject * owner_o = PyStackRef_AsPyObjectSteal (owner );
30533055 PyObject * name = _Py_SpecialMethods [oparg ].name ;
30543056 PyObject * self_or_null_o ;
3055- attr = PyStackRef_FromPyObjectSteal ( _PyObject_LookupSpecialMethod (owner_o , name , & self_or_null_o ) );
3056- if (PyStackRef_IsNull ( attr ) ) {
3057+ PyObject * attr_o = _PyObject_LookupSpecialMethod (owner_o , name , & self_or_null_o );
3058+ if (attr_o == NULL ) {
30573059 if (!_PyErr_Occurred (tstate )) {
30583060 _PyErr_Format (tstate , PyExc_TypeError ,
30593061 _Py_SpecialMethods [oparg ].error ,
30603062 Py_TYPE (owner_o )-> tp_name );
30613063 }
3064+ ERROR_IF (true, error );
30623065 }
3063- ERROR_IF (PyStackRef_IsNull (attr ), error );
3064- self_or_null = PyStackRef_FromPyObjectSteal (self_or_null_o );
3066+ attr = PyStackRef_FromPyObjectSteal (attr_o );
3067+ self_or_null = self_or_null_o == NULL ?
3068+ PyStackRef_NULL : PyStackRef_FromPyObjectSteal (self_or_null_o );
30653069 }
30663070
30673071 inst (WITH_EXCEPT_START , (exit_func , exit_self , lasti , unused , val -- exit_func , exit_self , lasti , unused , val , res )) {
@@ -3092,9 +3096,10 @@ dummy_func(
30923096 (void )lasti ; // Shut up compiler warning if asserts are off
30933097 PyObject * stack [5 ] = {NULL , PyStackRef_AsPyObjectBorrow (exit_self ), exc , val_o , tb };
30943098 int has_self = !PyStackRef_IsNull (exit_self );
3095- res = PyStackRef_FromPyObjectSteal (PyObject_Vectorcall (exit_func_o , stack + 2 - has_self ,
3096- (3 + has_self ) | PY_VECTORCALL_ARGUMENTS_OFFSET , NULL ));
3097- ERROR_IF (PyStackRef_IsNull (res ), error );
3099+ PyObject * res_o = PyObject_Vectorcall (exit_func_o , stack + 2 - has_self ,
3100+ (3 + has_self ) | PY_VECTORCALL_ARGUMENTS_OFFSET , NULL );
3101+ ERROR_IF (res_o == NULL , error );
3102+ res = PyStackRef_FromPyObjectSteal (res_o );
30983103 }
30993104
31003105 pseudo (SETUP_FINALLY , (-- unused ), (HAS_ARG )) = {
@@ -4539,9 +4544,10 @@ dummy_func(
45394544 /* If value is a unicode object, then we know the result
45404545 * of format(value) is value itself. */
45414546 if (!PyUnicode_CheckExact (value_o )) {
4542- res = PyStackRef_FromPyObjectSteal ( PyObject_Format (value_o , NULL ) );
4547+ PyObject * res_o = PyObject_Format (value_o , NULL );
45434548 PyStackRef_CLOSE (value );
4544- ERROR_IF (PyStackRef_IsNull (res ), error );
4549+ ERROR_IF (res_o == NULL , error );
4550+ res = PyStackRef_FromPyObjectSteal (res_o );
45454551 }
45464552 else {
45474553 res = value ;
0 commit comments