@@ -1318,10 +1318,6 @@ PyCompile_OpcodeStackEffect(int opcode, int oparg)
1318
1318
return stack_effect (opcode , oparg , -1 );
1319
1319
}
1320
1320
1321
- /* Add an opcode with no argument.
1322
- Returns 0 on failure, 1 on success.
1323
- */
1324
-
1325
1321
static int
1326
1322
basicblock_addop (basicblock * b , int opcode , int oparg , location loc )
1327
1323
{
@@ -1605,7 +1601,7 @@ cfg_builder_addop_j(cfg_builder *g, location loc,
1605
1601
}
1606
1602
1607
1603
#define ADDOP (C , LOC , OP ) \
1608
- RETURN_IF_ERROR(cfg_builder_addop_noarg(CFG_BUILDER(C), (OP), (LOC)));
1604
+ RETURN_IF_ERROR(cfg_builder_addop_noarg(CFG_BUILDER(C), (OP), (LOC)))
1609
1605
1610
1606
#define ADDOP_IN_SCOPE (C , LOC , OP ) { \
1611
1607
if (cfg_builder_addop_noarg(CFG_BUILDER(C), (OP), (LOC)) < 0) { \
@@ -1615,7 +1611,7 @@ cfg_builder_addop_j(cfg_builder *g, location loc,
1615
1611
}
1616
1612
1617
1613
#define ADDOP_LOAD_CONST (C , LOC , O ) \
1618
- RETURN_IF_ERROR(compiler_addop_load_const((C), (LOC), (O)));
1614
+ RETURN_IF_ERROR(compiler_addop_load_const((C), (LOC), (O)))
1619
1615
1620
1616
/* Same as ADDOP_LOAD_CONST, but steals a reference. */
1621
1617
#define ADDOP_LOAD_CONST_NEW (C , LOC , O ) { \
@@ -1640,31 +1636,31 @@ cfg_builder_addop_j(cfg_builder *g, location loc,
1640
1636
}
1641
1637
1642
1638
#define ADDOP_NAME (C , LOC , OP , O , TYPE ) \
1643
- RETURN_IF_ERROR(compiler_addop_name((C), (LOC), (OP), (C)->u->u_ ## TYPE, (O)));
1639
+ RETURN_IF_ERROR(compiler_addop_name((C), (LOC), (OP), (C)->u->u_ ## TYPE, (O)))
1644
1640
1645
1641
#define ADDOP_I (C , LOC , OP , O ) \
1646
- RETURN_IF_ERROR(cfg_builder_addop_i(CFG_BUILDER(C), (OP), (O), (LOC)));
1642
+ RETURN_IF_ERROR(cfg_builder_addop_i(CFG_BUILDER(C), (OP), (O), (LOC)))
1647
1643
1648
1644
#define ADDOP_JUMP (C , LOC , OP , O ) \
1649
- RETURN_IF_ERROR(cfg_builder_addop_j(CFG_BUILDER(C), (LOC), (OP), (O)));
1645
+ RETURN_IF_ERROR(cfg_builder_addop_j(CFG_BUILDER(C), (LOC), (OP), (O)))
1650
1646
1651
1647
#define ADDOP_COMPARE (C , LOC , CMP ) \
1652
- RETURN_IF_ERROR(compiler_addcompare((C), (LOC), (cmpop_ty)(CMP)));
1648
+ RETURN_IF_ERROR(compiler_addcompare((C), (LOC), (cmpop_ty)(CMP)))
1653
1649
1654
1650
#define ADDOP_BINARY (C , LOC , BINOP ) \
1655
- RETURN_IF_ERROR(addop_binary((C), (LOC), (BINOP), false));
1651
+ RETURN_IF_ERROR(addop_binary((C), (LOC), (BINOP), false))
1656
1652
1657
1653
#define ADDOP_INPLACE (C , LOC , BINOP ) \
1658
- RETURN_IF_ERROR(addop_binary((C), (LOC), (BINOP), true));
1654
+ RETURN_IF_ERROR(addop_binary((C), (LOC), (BINOP), true))
1659
1655
1660
- #define ADD_YIELD_FROM (C , LOC , await ) \
1661
- RETURN_IF_ERROR(compiler_add_yield_from((C), (LOC), (await)));
1656
+ #define ADD_YIELD_FROM (C , LOC , await ) \
1657
+ RETURN_IF_ERROR(compiler_add_yield_from((C), (LOC), (await)))
1662
1658
1663
- #define POP_EXCEPT_AND_RERAISE (C , LOC ) \
1664
- RETURN_IF_ERROR(compiler_pop_except_and_reraise((C), (LOC)));
1659
+ #define POP_EXCEPT_AND_RERAISE (C , LOC ) \
1660
+ RETURN_IF_ERROR(compiler_pop_except_and_reraise((C), (LOC)))
1665
1661
1666
1662
#define ADDOP_YIELD (C , LOC ) \
1667
- RETURN_IF_ERROR(addop_yield((C), (LOC)));
1663
+ RETURN_IF_ERROR(addop_yield((C), (LOC)))
1668
1664
1669
1665
/* VISIT and VISIT_SEQ takes an ASDL type as their second argument. They use
1670
1666
the ASDL name to synthesize the name of the C type and the visit function.
@@ -1784,17 +1780,13 @@ compiler_enter_scope(struct compiler *c, identifier name,
1784
1780
c -> c_nestlevel ++ ;
1785
1781
1786
1782
cfg_builder * g = CFG_BUILDER (c );
1787
- if (cfg_builder_init (g ) < 0 ) {
1788
- return ERROR ;
1789
- }
1783
+ RETURN_IF_ERROR (cfg_builder_init (g ));
1790
1784
1791
1785
if (u -> u_scope_type == COMPILER_SCOPE_MODULE ) {
1792
1786
loc .lineno = 0 ;
1793
1787
}
1794
1788
else {
1795
- if (compiler_set_qualname (c ) < 0 ){
1796
- return ERROR ;
1797
- }
1789
+ RETURN_IF_ERROR (compiler_set_qualname (c ));
1798
1790
}
1799
1791
ADDOP_I (c , loc , RESUME , 0 );
1800
1792
@@ -2110,9 +2102,7 @@ compiler_unwind_fblock_stack(struct compiler *c, location *ploc,
2110
2102
}
2111
2103
struct fblockinfo copy = * top ;
2112
2104
c -> u -> u_nfblocks -- ;
2113
- if (compiler_unwind_fblock (c , ploc , & copy , preserve_tos ) < 0 ) {
2114
- return ERROR ;
2115
- }
2105
+ RETURN_IF_ERROR (compiler_unwind_fblock (c , ploc , & copy , preserve_tos ));
2116
2106
RETURN_IF_ERROR (compiler_unwind_fblock_stack (c , ploc , preserve_tos , loop ));
2117
2107
c -> u -> u_fblock [c -> u -> u_nfblocks ] = copy ;
2118
2108
c -> u -> u_nfblocks ++ ;
@@ -6204,7 +6194,7 @@ compiler_subscript(struct compiler *c, expr_ty e)
6204
6194
}
6205
6195
6206
6196
/* Returns the number of the values emitted,
6207
- * thus are needed to build the slice, or 0 if there is an error. */
6197
+ * thus are needed to build the slice, or -1 if there is an error. */
6208
6198
static int
6209
6199
compiler_slice (struct compiler * c , expr_ty s )
6210
6200
{
0 commit comments