Merge pull request #20870 from jketema/exp-arg-fix

C++: `getExpandedArgument` fixes
This commit is contained in:
Jeroen Ketema
2025-11-19 17:10:56 +01:00
committed by GitHub

View File

@@ -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
@@ -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