Convert constant vector expressions in binary expressions

Fixes not being able to compare with eg [1, 2, 3]
This commit is contained in:
Bill Currie 2019-06-06 06:44:19 +09:00
parent 319ecfbbfa
commit d00a2ef82d

View file

@ -726,6 +726,7 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
expr_type_t *expr_type;
convert_name (e1);
e1 = convert_vector (e1);
if (e1->type == ex_block && e1->e.block.is_call
&& has_function_call (e2) && e1->e.block.result) {
e = new_temp_def_expr (get_type (e1->e.block.result));
@ -735,6 +736,7 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
return e1;
convert_name (e2);
e2 = convert_vector (e2);
if (e2->type == ex_error)
return e2;