summaryrefslogtreecommitdiffstatshomepage
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-03-25 23:06:48 +0000
committerDamien George <damien.p.george@gmail.com>2015-03-25 23:06:48 +0000
commit44f65c0e2f5ce27ce90bbec218ecb39cba9d75a2 (patch)
tree5e92b9a1d3a27ed3079536b0dfd7e29d06bd150e /py/compile.c
parent5e1d993f5444c4617813943ce8376a69c0fefa8f (diff)
downloadmicropython-44f65c0e2f5ce27ce90bbec218ecb39cba9d75a2.tar.gz
micropython-44f65c0e2f5ce27ce90bbec218ecb39cba9d75a2.zip
py: Fix bug in compiler which allowed through illegal augmented assign.
It allowed such things as (a, b) += c.
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c
index f64a9e2f62..554d74b30c 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -858,6 +858,9 @@ STATIC void c_assign(compiler_t *comp, mp_parse_node_t pn, assign_kind_t assign_
// empty tuple
goto cannot_assign;
} else if (MP_PARSE_NODE_IS_STRUCT_KIND(pns->nodes[0], PN_testlist_comp)) {
+ if (assign_kind != ASSIGN_STORE) {
+ goto bad_aug;
+ }
pns = (mp_parse_node_struct_t*)pns->nodes[0];
goto testlist_comp;
} else {