V0.8: Fail on a zero width repeat

This patch mirrors what was done in development to fail for zero
width repeats. Actually development supports them in some contexts,
this is allowed in 1364-2005, but V0.8 doesn't support them at all.
This commit is contained in:
Cary R 2008-11-21 18:42:52 -08:00 committed by Stephen Williams
parent 7dc473db8d
commit bb92974839
2 changed files with 14 additions and 0 deletions

View File

@ -444,6 +444,13 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope, bool) const
return 0;
}
if (rep->value().is_zero()) {
cerr << get_line() << ": error: Concatenation repeat "
<< "may not be zero." << endl;
des->errors += 1;
return 0;
}
repeat = rep;
}

View File

@ -1357,6 +1357,13 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
des->errors += 1;
return 0;
}
if (erep->value().is_zero()) {
cerr << get_line() << ": error: Concatenation repeat "
<< "may not be zero." << endl;
des->errors += 1;
return 0;
}
}
/* The operands of the concatenation must contain all