Skip to content

Commit

Permalink
Call lineTrack if we don't add if stmt
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Dec 30, 2024
1 parent 082ee58 commit 5ca9118
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/V3Coverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,11 @@ class CoverageVisitor final : public VNVisitor {

iterateChildren(nodep);

if (!m_state.m_on) { return; }

// Current method cannot run coverage for impure statements
if (!nodep->condp()->isPure()) { return; }
if (!m_state.m_on || !nodep->condp()->isPure()) {
// Current method cannot run coverage for impure statements
lineTrack(nodep);
return;
}

auto fakeIf = new AstIf(nodep->fileline(), nodep->condp()->cloneTree(true));
FileLine* newFl = new FileLine{nodep->fileline()};
Expand Down

0 comments on commit 5ca9118

Please sign in to comment.