Skip to content

Commit 8d4d673

Browse files
committed
py/parse: When looking up consts, check they exist before checking type.
1 parent 2b302da commit 8d4d673

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ STATIC bool fold_constants(parser_t *parser, const rule_t *rule, size_t num_args
620620
}
621621
mp_obj_t dest[2];
622622
mp_load_method_maybe(elem->value, q_attr, dest);
623-
if (!(MP_OBJ_IS_INT(dest[0]) && dest[1] == MP_OBJ_NULL)) {
623+
if (!(dest[0] != MP_OBJ_NULL && MP_OBJ_IS_INT(dest[0]) && dest[1] == MP_OBJ_NULL)) {
624624
return false;
625625
}
626626
arg0 = dest[0];

0 commit comments

Comments
 (0)