Skip to content

Commit 293ae8c

Browse files
author
Your Name
committed
Fix valueflow issue
1 parent 312193e commit 293ae8c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/forwardanalyzer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,10 @@ namespace {
785785
ft.analyzer->assume(condTok, true);
786786
Progress p = ft.updateBranch(thenBranch, depth - 1);
787787

788-
analyzer->assume(condTok, false);
788+
// Only commit the condition as false on the main path when it actually
789+
// matters
790+
if (thenBranch.isDead())
791+
analyzer->assume(condTok, false);
789792
if (hasElse) {
790793
if (updateBranch(elseBranch, depth - 1) == Progress::Break)
791794
return Break();

0 commit comments

Comments
 (0)