Fix assertion failure for function body with single null statement (GH issue #411)
(cherry picked from commit 94b503fc64)
This commit is contained in:
parent
27986477fb
commit
bfac44a630
|
|
@ -5275,8 +5275,11 @@ void PFunction::elaborate(Design*des, NetScope*scope) const
|
||||||
}
|
}
|
||||||
assert(def);
|
assert(def);
|
||||||
|
|
||||||
ivl_assert(*this, statement_);
|
NetProc*st;
|
||||||
NetProc*st = statement_->elaborate(des, scope);
|
if (statement_ == 0) {
|
||||||
|
st = new NetBlock(NetBlock::SEQU, 0);
|
||||||
|
} else {
|
||||||
|
st = statement_->elaborate(des, scope);
|
||||||
if (st == 0) {
|
if (st == 0) {
|
||||||
cerr << statement_->get_fileline() << ": error: Unable to elaborate "
|
cerr << statement_->get_fileline() << ": error: Unable to elaborate "
|
||||||
"statement in function " << scope->basename() << "." << endl;
|
"statement in function " << scope->basename() << "." << endl;
|
||||||
|
|
@ -5284,6 +5287,7 @@ void PFunction::elaborate(Design*des, NetScope*scope) const
|
||||||
des->errors += 1;
|
des->errors += 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Handle any variable initialization statements in this scope.
|
// Handle any variable initialization statements in this scope.
|
||||||
// For automatic functions, these statements need to be executed
|
// For automatic functions, these statements need to be executed
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue