Skip to content

Commit ff6b8c5

Browse files
committed
Swift: Replace 'CallExpr' with 'ApplyExpr'. This is needed because not all the calls inside the interpolated string computations are 'CallExpr's.
1 parent 3028b80 commit ff6b8c5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

swift/ql/lib/codeql/swift/dataflow/Ssa.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module Ssa {
7575
cached
7676
predicate isInoutDef(ExprCfgNode argument) {
7777
exists(
78-
CallExpr c, BasicBlock bb, int blockIndex, int argIndex, VarDecl v, InOutExpr argExpr // TODO: use CFG node for assignment expr
78+
ApplyExpr c, BasicBlock bb, int blockIndex, int argIndex, VarDecl v, InOutExpr argExpr // TODO: use CFG node for assignment expr
7979
|
8080
this.definesAt(v, bb, blockIndex) and
8181
bb.getNode(blockIndex).getNode().asAstNode() = c and

swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ abstract class ArgumentNode extends Node {
203203

204204
private module ArgumentNodes {
205205
class NormalArgumentNode extends ExprNode, ArgumentNode {
206-
NormalArgumentNode() { exists(CallExpr call | call.getAnArgument().getExpr() = this.asExpr()) }
206+
NormalArgumentNode() { exists(ApplyExpr call | call.getAnArgument().getExpr() = this.asExpr()) }
207207

208208
override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
209209
call.asCall().getArgument(pos.(PositionalArgumentPosition).getIndex()).getExpr() =

swift/ql/lib/codeql/swift/dataflow/internal/SsaImplSpecific.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ predicate variableWrite(BasicBlock bb, int i, SourceVariable v, boolean certain)
2929
certain = true
3030
)
3131
or
32-
exists(CallExpr call, Argument arg |
32+
exists(ApplyExpr call, Argument arg |
3333
arg.getExpr().(InOutExpr).getSubExpr() = v.getAnAccess() and
3434
call.getAnArgument() = arg and
3535
bb.getNode(i).getNode().asAstNode() = call and

0 commit comments

Comments
 (0)