C++: Also fix variableMustBeNullTerminated.

This commit is contained in:
Geoffrey White
2021-10-19 16:48:06 +01:00
parent b4b8392748
commit 57fe4b9a31

View File

@@ -120,8 +120,8 @@ predicate variableMustBeNullTerminated(VariableAccess va) {
// Simplified: check that `p` may not be null terminated on *any*
// path to `use` (including the one found via `parameterUsePair`)
not exists(Expr e, BasicBlock bb1, int pos1, BasicBlock bb2, int pos2 |
mayAddNullTerminator(e, p.getAnAccess()) and
bb1.getNode(pos1) = e and
mayAddNullTerminator(pragma[only_bind_into](e), p.getAnAccess()) and
pragma[only_bind_into](bb1).getNode(pos1) = e and
bb2.getNode(pos2) = use
|
bb1 = bb2 and pos1 < pos2