Skip to content

Commit cd4ff54

Browse files
committed
C++: Improve performance of Printf::callsVariadicFormatter.
1 parent f598b26 commit cd4ff54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,15 @@ private predicate callsVariadicFormatter(
168168
) {
169169
// calls a variadic formatter with `formatParamIndex`, `outputParamIndex` linked
170170
exists(FunctionCall fc, int format, int output |
171-
variadicFormatter(fc.getTarget(), type, format, output) and
171+
variadicFormatter(pragma[only_bind_into](fc.getTarget()), type, format, output) and
172172
fc.getEnclosingFunction() = f and
173173
fc.getArgument(format) = f.getParameter(formatParamIndex).getAnAccess() and
174174
fc.getArgument(output) = f.getParameter(outputParamIndex).getAnAccess()
175175
)
176176
or
177177
// calls a variadic formatter with only `formatParamIndex` linked
178178
exists(FunctionCall fc, string calledType, int format, int output |
179-
variadicFormatter(fc.getTarget(), calledType, format, output) and
179+
variadicFormatter(pragma[only_bind_into](fc.getTarget()), calledType, format, output) and
180180
fc.getEnclosingFunction() = f and
181181
fc.getArgument(format) = f.getParameter(formatParamIndex).getAnAccess() and
182182
not fc.getArgument(output) = f.getParameter(_).getAnAccess() and

0 commit comments

Comments
 (0)