Commit 8d4d6731 authored by Damien George's avatar Damien George
Browse files

py/parse: When looking up consts, check they exist before checking type.

parent 2b302dad
......@@ -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];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment