Error message for duplicate declare of arrays.
Replace an assertion with an error message for duplicate declartion of arrays.
This commit is contained in:
parent
5352a0cc40
commit
9a96d80a9e
12
PWire.cc
12
PWire.cc
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue