Fix LATCH warning on function local variables (#4221) (#4284)

This commit is contained in:
Julien Margetts
2023-06-12 09:24:46 -04:00
committed by GitHub
parent 5094e94df1
commit ac4315e145
6 changed files with 92 additions and 2 deletions
+4 -1
View File
@@ -320,7 +320,8 @@ private:
// VISITORS
void visit(AstVarRef* nodep) override {
const AstVar* const varp = nodep->varp();
if (nodep->access().isWriteOrRW() && varp->isSignal() && !varp->isUsedLoopIdx()) {
if (nodep->access().isWriteOrRW() && varp->isSignal() && !varp->isUsedLoopIdx()
&& !varp->isFuncLocalSticky()) {
m_graph.addAssignment(nodep);
}
}
@@ -333,6 +334,8 @@ private:
m_graph.addPathVertex(branchp, "ELSE");
iterateAndNextConstNull(nodep->elsesp());
m_graph.currentp(parentp);
} else {
iterateChildrenConst(nodep);
}
}
//--------------------