C++: Fix cpp/guarded-free FPs when there are other blocks depending on the guard

This commit is contained in:
Jeroen Ketema
2024-11-14 11:48:17 +01:00
parent 570260b4dc
commit c86bbbb063
3 changed files with 4 additions and 8 deletions

View File

@@ -22,5 +22,6 @@ from GuardCondition gc, FreeCall fc, Variable v, BasicBlock bb
where
gc.ensuresEq(v.getAnAccess(), 0, bb, false) and
fc.getArgument(0) = v.getAnAccess() and
bb = fc.getEnclosingStmt()
bb = fc.getEnclosingStmt() and
strictcount(BasicBlock bb2 | gc.ensuresEq(_, 0, bb2, _) | bb2) = 1
select gc, "unnecessary NULL check before call to $@", fc, "free"