Skip to content

Commit 44f65c0

Browse files
committed
py: Fix bug in compiler which allowed through illegal augmented assign.
It allowed such things as (a, b) += c.
1 parent 5e1d993 commit 44f65c0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

py/compile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,9 @@ STATIC void c_assign(compiler_t *comp, mp_parse_node_t pn, assign_kind_t assign_
858858
// empty tuple
859859
goto cannot_assign;
860860
} else if (MP_PARSE_NODE_IS_STRUCT_KIND(pns->nodes[0], PN_testlist_comp)) {
861+
if (assign_kind != ASSIGN_STORE) {
862+
goto bad_aug;
863+
}
861864
pns = (mp_parse_node_struct_t*)pns->nodes[0];
862865
goto testlist_comp;
863866
} else {

0 commit comments

Comments
 (0)