Fix case where booleans are compared against vectors
This commit is contained in:
parent
6b73cc39a5
commit
3987e0753d
|
|
@ -100,6 +100,14 @@ static vhdl_expr *translate_unary(ivl_expr_t e)
|
||||||
static vhdl_expr *translate_numeric(vhdl_expr *lhs, vhdl_expr *rhs,
|
static vhdl_expr *translate_numeric(vhdl_expr *lhs, vhdl_expr *rhs,
|
||||||
vhdl_binop_t op)
|
vhdl_binop_t op)
|
||||||
{
|
{
|
||||||
|
// May need to make either side Boolean for operators
|
||||||
|
// to work
|
||||||
|
vhdl_type boolean(VHDL_TYPE_BOOLEAN);
|
||||||
|
if (lhs->get_type()->get_name() == VHDL_TYPE_BOOLEAN)
|
||||||
|
rhs = rhs->cast(&boolean);
|
||||||
|
else if (rhs->get_type()->get_name() == VHDL_TYPE_BOOLEAN)
|
||||||
|
lhs = lhs->cast(&boolean);
|
||||||
|
|
||||||
vhdl_type *rtype = new vhdl_type(*lhs->get_type());
|
vhdl_type *rtype = new vhdl_type(*lhs->get_type());
|
||||||
return new vhdl_binop_expr(lhs, op, rhs, rtype);
|
return new vhdl_binop_expr(lhs, op, rhs, rtype);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue