Skip to content

Commit 0d994c1

Browse files
authored
Merge pull request #18831 from owen-mc/go/join-order-fix-2
Go: Improve bad join order in guardingCall
2 parents 6437bd6 + d9d909a commit 0d994c1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll

+10-2
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,23 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
379379
)
380380
}
381381

382+
bindingset[inp, c]
383+
pragma[inline_late]
384+
private Node getInputNode(FunctionInput inp, CallNode c) { result = inp.getNode(c) }
385+
386+
bindingset[outp, c]
387+
pragma[inline_late]
388+
private Node getOutputNode(FunctionOutput outp, CallNode c) { result = outp.getNode(c) }
389+
382390
pragma[noinline]
383391
private predicate guardingCall(
384392
Node g, Function f, FunctionInput inp, FunctionOutput outp, DataFlow::Property p, CallNode c,
385393
Node nd, Node resNode
386394
) {
387395
guardingFunction(g, f, inp, outp, p) and
388396
c = f.getACall() and
389-
nd = inp.getNode(c) and
390-
localFlow(pragma[only_bind_out](outp.getNode(c)), resNode)
397+
nd = getInputNode(inp, c) and
398+
localFlow(getOutputNode(outp, c), resNode)
391399
}
392400

393401
private predicate onlyPossibleReturnSatisfyingProperty(

0 commit comments

Comments
 (0)