Skip to content

Commit 5c50855

Browse files
committed
Efficiency improvement (force a better join order)
1 parent 0914161 commit 5c50855

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,14 @@ predicate isNonConst(DataFlow::Node node) {
8686
c = node.asIndirectExpr()
8787
// and not hasConstSpecifier(c.getType())
8888
) and
89-
not exists(Function func, FunctionInput input, FunctionOutput output, CallInstruction call |
89+
not exists(FunctionInput input, FunctionOutput output, CallInstruction call |
9090
// NOTE: we must include dataflow and taintflow. e.g., including only dataflow we will find sprintf
9191
// variant function's output are now possible non-const sources
9292
(
93-
func.(DataFlowFunction).hasDataFlow(input, output) or
94-
func.(TaintFunction).hasTaintFlow(input, output)
93+
pragma[only_bind_out](call.getStaticCallTarget()).(DataFlowFunction).hasDataFlow(input, output) or
94+
pragma[only_bind_out](call.getStaticCallTarget()).(TaintFunction).hasTaintFlow(input, output)
9595
) and
96-
node = callOutput(call, output) and
97-
call.getStaticCallTarget() = func
96+
node = callOutput(call, output)
9897
) and
9998
not exists(Call c |
10099
c.getTarget().hasDefinition() and

0 commit comments

Comments
 (0)