Error message for duplicate declare of arrays.

Replace an assertion with an error message for duplicate
declartion of arrays.
This commit is contained in:
Cary R 2007-11-07 19:48:47 -08:00 committed by Stephen Williams
parent 5352a0cc40
commit 9a96d80a9e
1 changed files with 8 additions and 4 deletions

View File

@ -197,9 +197,13 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type)
void PWire::set_memory_idx(PExpr*ldx, PExpr*rdx)
{
assert(lidx_ == 0);
assert(ridx_ == 0);
lidx_ = ldx;
ridx_ = rdx;
if (lidx_ != 0 || ridx_ != 0) {
cerr << get_line() << ": error: Array ``" << hname_
<< "'' has already been declared." << endl;
error_cnt_ += 1;
} else {
lidx_ = ldx;
ridx_ = rdx;
}
}