Add predicted stack overflow warning (#4799).

This commit is contained in:
Wilson Snyder
2024-01-06 16:14:58 -05:00
parent 7507c5f56c
commit 0ca90257a5
13 changed files with 330 additions and 6 deletions
+5 -5
View File
@@ -71,7 +71,7 @@ public:
: m_startNodep{nodep}
, m_assertNoDups{assertNoDups}
, m_osp{osp} {
if (nodep) iterateConst(nodep);
iterateConstNull(nodep);
}
~InstrCountVisitor() override = default;
@@ -208,12 +208,12 @@ private:
const uint32_t elseCount = m_instrCount;
reset();
if (ifCount < elseCount) {
m_instrCount = savedCount + elseCount;
if (nodep->thenp()) nodep->thenp()->user2(0); // Don't dump it
} else {
if (ifCount >= elseCount) {
m_instrCount = savedCount + ifCount;
if (nodep->elsep()) nodep->elsep()->user2(0); // Don't dump it
} else {
m_instrCount = savedCount + elseCount;
if (nodep->thenp()) nodep->thenp()->user2(0); // Don't dump it
}
}
void visit(AstCAwait* nodep) override {