Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions swift/ql/lib/codeql/swift/dataflow/Ssa.qll
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module Ssa {

EntryNode asKeyPath() { none() }

abstract Type getType();

DeclRefExpr getAnAccess() { result.getDecl() = this.asVarDecl() }

Location getLocation() {
Expand All @@ -48,6 +50,10 @@ module Ssa {

override string toString() { result = v.toString() }

override Type getType() {
result = v.getType()
}

override VarDecl asVarDecl() { result = v }
}

Expand All @@ -56,6 +62,10 @@ module Ssa {

KeyPathSourceVariable() { this = TKeyPathSourceVariable(enter) }

override Type getType() {
result = enter.getScope().(KeyPathExpr).getRoot().getType()
}

override string toString() { result = enter.toString() }

override EntryNode asKeyPath() { result = enter }
Expand Down
Loading