@@ -667,8 +667,8 @@ codegen_unwind_fblock_stack(compiler *c, location *ploc,
667667 _PyCompile_PopFBlock (c , top -> fb_type , top -> fb_block );
668668 RETURN_IF_ERROR (codegen_unwind_fblock (c , ploc , & copy , preserve_tos ));
669669 RETURN_IF_ERROR (codegen_unwind_fblock_stack (c , ploc , preserve_tos , loop ));
670- _PyCompile_PushFBlock (c , copy .fb_loc , copy .fb_type , copy .fb_block ,
671- copy .fb_exit , copy .fb_datum );
670+ RETURN_IF_ERROR ( _PyCompile_PushFBlock (c , copy .fb_loc , copy .fb_type , copy .fb_block ,
671+ copy .fb_exit , copy .fb_datum )) ;
672672 return SUCCESS ;
673673}
674674
@@ -715,10 +715,14 @@ codegen_setup_annotations_scope(compiler *c, location loc,
715715
716716 // if .format > VALUE_WITH_FAKE_GLOBALS: raise NotImplementedError
717717 PyObject * value_with_fake_globals = PyLong_FromLong (_Py_ANNOTATE_FORMAT_VALUE_WITH_FAKE_GLOBALS );
718+ if (value_with_fake_globals == NULL ) {
719+ return ERROR ;
720+ }
721+
718722 assert (!SYMTABLE_ENTRY (c )-> ste_has_docstring );
719723 _Py_DECLARE_STR (format , ".format" );
720724 ADDOP_I (c , loc , LOAD_FAST , 0 );
721- ADDOP_LOAD_CONST (c , loc , value_with_fake_globals );
725+ ADDOP_LOAD_CONST_NEW (c , loc , value_with_fake_globals ); // macro handles decref of value_with_fake_globals
722726 ADDOP_I (c , loc , COMPARE_OP , (Py_GT << 5 ) | compare_masks [Py_GT ]);
723727 NEW_JUMP_TARGET_LABEL (c , body );
724728 ADDOP_JUMP (c , loc , POP_JUMP_IF_FALSE , body );
@@ -816,7 +820,7 @@ codegen_deferred_annotations_body(compiler *c, location loc,
816820
817821 VISIT (c , expr , st -> v .AnnAssign .annotation );
818822 ADDOP_I (c , LOC (st ), COPY , 2 );
819- ADDOP_LOAD_CONST_NEW (c , LOC (st ), mangled );
823+ ADDOP_LOAD_CONST_NEW (c , LOC (st ), mangled ); // macro handles decref of mangle
820824 // stack now contains <annos> <name> <annos> <value>
821825 ADDOP (c , loc , STORE_SUBSCR );
822826 // stack now contains <annos>
@@ -3279,7 +3283,11 @@ codegen_nameop(compiler *c, location loc,
32793283 }
32803284
32813285 int scope = _PyST_GetScope (SYMTABLE_ENTRY (c ), mangled );
3282- RETURN_IF_ERROR (scope );
3286+ if (scope == -1 ) {
3287+ Py_DECREF (mangled );
3288+ return ERROR ;
3289+ }
3290+
32833291 _PyCompile_optype optype ;
32843292 Py_ssize_t arg = 0 ;
32853293 if (_PyCompile_ResolveNameop (c , mangled , scope , & optype , & arg ) < 0 ) {
0 commit comments