V0.8: complain about a negative repeat value.

This patch mirrors what was done in development to complain
about a negative repeat value.
This commit is contained in:
Cary R 2008-11-21 17:49:41 -08:00 committed by Stephen Williams
parent c8bffe728a
commit abc2aa17d2
2 changed files with 17 additions and 0 deletions

View File

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

View File

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