diff options
author | Damien George <damien.p.george@gmail.com> | 2016-03-19 21:36:32 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-03-19 21:36:32 +0000 |
commit | 8d4d6731f56f9b1163f19d2455e8998aa0499afd (patch) | |
tree | fd5a7fd043be14b6665da37f799de04ce6109a47 /py/parse.c | |
parent | 2b302dad512fb3540db8b0b3a4b33337dd5d81a2 (diff) | |
download | micropython-8d4d6731f56f9b1163f19d2455e8998aa0499afd.tar.gz micropython-8d4d6731f56f9b1163f19d2455e8998aa0499afd.zip |
py/parse: When looking up consts, check they exist before checking type.
Diffstat (limited to 'py/parse.c')
-rw-r--r-- | py/parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/parse.c b/py/parse.c index d1f29139a2..b57e82d459 100644 --- a/py/parse.c +++ b/py/parse.c @@ -620,7 +620,7 @@ STATIC bool fold_constants(parser_t *parser, const rule_t *rule, size_t num_args } mp_obj_t dest[2]; mp_load_method_maybe(elem->value, q_attr, dest); - if (!(MP_OBJ_IS_INT(dest[0]) && dest[1] == MP_OBJ_NULL)) { + if (!(dest[0] != MP_OBJ_NULL && MP_OBJ_IS_INT(dest[0]) && dest[1] == MP_OBJ_NULL)) { return false; } arg0 = dest[0]; |