Skip to content

Commit 0e5cfd3

Browse files
committed
C++: Rename the predicate and make it private.
1 parent 5379b25 commit 0e5cfd3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cpp/ql/lib/semmle/code/cpp/commons/NullTermination.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private predicate mayAddNullTerminatorHelper(Expr e, VariableAccess va, Expr e0)
1212
}
1313

1414
bindingset[n1, n2]
15-
predicate nodeBefore(ControlFlowNode n1, ControlFlowNode n2) {
15+
private predicate controlFlowNodeSuccessorTransitive(ControlFlowNode n1, ControlFlowNode n2) {
1616
exists(BasicBlock bb1, int pos1, BasicBlock bb2, int pos2 |
1717
pragma[only_bind_into](bb1).getNode(pos1) = n1 and
1818
pragma[only_bind_into](bb2).getNode(pos2) = n2 and
@@ -45,7 +45,7 @@ predicate mayAddNullTerminator(Expr e, VariableAccess va) {
4545
// Assignment to another stack variable
4646
exists(Expr e0 |
4747
mayAddNullTerminatorHelper(pragma[only_bind_into](e), va, pragma[only_bind_into](e0)) and
48-
nodeBefore(e, e0)
48+
controlFlowNodeSuccessorTransitive(e, e0)
4949
)
5050
or
5151
// Assignment to non-stack variable
@@ -129,7 +129,7 @@ predicate variableMustBeNullTerminated(VariableAccess va) {
129129
// path to `use` (including the one found via `parameterUsePair`)
130130
not exists(Expr e |
131131
mayAddNullTerminator(pragma[only_bind_into](e), p.getAnAccess()) and
132-
nodeBefore(e, use)
132+
controlFlowNodeSuccessorTransitive(e, use)
133133
)
134134
)
135135
)

0 commit comments

Comments
 (0)