Skip to content

Commit af1036b

Browse files
committed
Ruby: Fix joinorder.
1 parent 8dcd6e6 commit af1036b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowDispatch.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,9 @@ private CfgScope getTargetInstance(DataFlowCall call, string method) {
692692
)
693693
}
694694

695+
pragma[nomagic]
696+
private File callGetFile(DataFlowCall call) { result = call.asCall().getLocation().getFile() }
697+
695698
bindingset[call, result]
696699
pragma[inline_late]
697700
private CfgScope privateFilter(DataFlowCall call) {
@@ -700,7 +703,7 @@ private CfgScope privateFilter(DataFlowCall call) {
700703
// This may remove some plausible targets, but also removes a lot of
701704
// implausible targets
702705
(
703-
isToplevelMethodInFile(result, call.asCall().getLocation().getFile()) or
706+
isToplevelMethodInFile(result, callGetFile(call)) or
704707
not isToplevelMethodInFile(result, _)
705708
)
706709
}

0 commit comments

Comments
 (0)