Skip to content
Merged
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
8 changes: 6 additions & 2 deletions cpp/ql/lib/semmle/code/cpp/Compilation.qll
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Compilation extends @compilation {
/**
* Gets an expanded argument passed to the extractor on this invocation.
*/
string getAnExpandedArgument() { result = this.getArgument(_) }
string getAnExpandedArgument() { result = this.getExpandedArgument(_) }

/**
* Gets the `i`th expanded argument passed to the extractor on this
Expand All @@ -107,7 +107,11 @@ class Compilation extends @compilation {
* includes the arguments from that file, rather than just taking the
* argument literally.
*/
string getExpandedArgument(int i) { compilation_expanded_args(this, i, result) }
string getExpandedArgument(int i) {
if exists(string arg | compilation_expanded_args(this, _, arg))
then compilation_expanded_args(this, i, result)
else result = this.getArgument(i)
}

/**
* Gets the total amount of CPU time spent processing all the files in the
Expand Down
Loading