Skip to content
Draft
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
7 changes: 6 additions & 1 deletion rust/ql/lib/codeql/files/FileSystem.qll
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ extensible predicate additionalExternalFile(string relativePath);

/** A file. */
class File extends Container, Impl::File {
pragma[nomagic]
private predicate fromSource0() {
exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this)
}

/**
* Holds if this file was extracted from the source code of the target project
* (rather than another location such as inside a dependency).
*/
predicate fromSource() {
exists(ExtractorStep s | s.getAction() = "Extract" and s.getFile() = this) and
this.fromSource0() and
not additionalExternalFile(this.getRelativePath())
}

Expand Down
Loading