Handle the error case that the rval fails
There are some cases where the r-value for an assignment just can't be elaborated. Instead of segfaulting on the error, handle it by assuming that the nullptr came from an error message, and ignore it going forward.
This commit is contained in:
parent
4679c722e3
commit
dc203a20ba
|
|
@ -1124,7 +1124,10 @@ void NetAssign::dump(ostream&o, unsigned ind) const
|
|||
if (const NetExpr*de = get_delay())
|
||||
o << "#(" << *de << ") ";
|
||||
|
||||
o << *rval() << ";" << endl;
|
||||
if (rval())
|
||||
o << *rval() << ";" << endl;
|
||||
else
|
||||
o << "<rval elaboration error>;" << endl;
|
||||
}
|
||||
|
||||
void NetAssignNB::dump(ostream&o, unsigned ind) const
|
||||
|
|
@ -1142,7 +1145,10 @@ void NetAssignNB::dump(ostream&o, unsigned ind) const
|
|||
o << *event_;
|
||||
}
|
||||
|
||||
o << *rval() << ";" << endl;
|
||||
if (rval())
|
||||
o << *rval() << ";" << endl;
|
||||
else
|
||||
o << "rval elaboration error>;" << endl;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -441,8 +441,11 @@ bool NetAssign::eval_func_lval_(const LineInfo&loc,
|
|||
bool NetAssign::evaluate_function(const LineInfo&loc,
|
||||
map<perm_string,LocalVar>&context_map) const
|
||||
{
|
||||
// Evaluate the r-value expression.
|
||||
NetExpr*rval_result = rval()->evaluate_function(loc, context_map);
|
||||
// Evaluate the r-value expression.
|
||||
const NetExpr*use_rval = rval();
|
||||
if (use_rval == 0)
|
||||
return false;
|
||||
NetExpr*rval_result = use_rval->evaluate_function(loc, context_map);
|
||||
if (rval_result == 0)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue