Dfg: Fix crash on additional driver from non-DFG logic

Ensure variables written by non-DFG code are kept

Fixes #3740
This commit is contained in:
Geza Lore
2022-11-12 11:55:49 +00:00
parent 6736e92cdb
commit dbcaad99c5
6 changed files with 55 additions and 9 deletions
+3
View File
@@ -94,7 +94,10 @@ class AstToDfgVisitor final : public VNVisitor {
nodep->foreach([this](const AstVarRef* refp) {
// No need to (and in fact cannot) mark variables with unsupported dtypes
if (!DfgVertex::isSupportedDType(refp->varp()->dtypep())) return;
// Mark vertex as having a module reference outside current DFG
getNet(refp->varp())->setHasModRefs();
// Mark variable as written from non-DFG logic
if (refp->access().isWriteOrRW()) refp->varp()->user3(true);
});
}