Fix core dump on bad dotted reference.

This commit is contained in:
Wilson Snyder
2023-02-05 12:45:14 -05:00
parent eb5aad94f1
commit 70eceae3d8
4 changed files with 43 additions and 6 deletions
+8 -6
View File
@@ -2739,13 +2739,15 @@ private:
ok = m_ds.m_dotPos == DP_SCOPE;
} else if (const AstNodeFTask* const ftaskp = VN_CAST(foundp->nodep(), NodeFTask)) {
if (!ftaskp->isFunction()) {
// The condition is true for tasks, properties and void functions.
// In these cases, the parentheses may be skipped.
AstFuncRef* const funcRefp
= new AstFuncRef{nodep->fileline(), nodep->name(), nullptr};
nodep->replaceWith(funcRefp);
VL_DO_DANGLING(pushDeletep(nodep), nodep);
ok = m_ds.m_dotPos == DP_NONE;
if (ok) {
// The condition is true for tasks, properties and void functions.
// In these cases, the parentheses may be skipped.
AstFuncRef* const funcRefp
= new AstFuncRef{nodep->fileline(), nodep->name(), nullptr};
nodep->replaceWith(funcRefp);
VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
}
}
//