Fix for GitHub issue #18 : undef propagation of const multiplies is incorrect.

When an expression is elaborated, the compiler converts multiplies with
one constamt zero operand into a constant zero value. This is only valid
if the other operand is not a 4-state variable.
This commit is contained in:
Martin Whitaker 2014-02-27 19:30:28 +00:00
parent 5dcd2e8957
commit ed2e339dd6
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*,
return tmp;
}
if (rp_val.is_zero()) {
if (rp_val.is_zero() && (lp->expr_type() != IVL_VT_LOGIC)) {
NetEConst*tmp = make_const_0(expr_wid);
tmp->cast_signed(signed_flag_);
tmp->set_line(*this);