mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: Make getExpandedArgument more robust
This make the predicate give back sensible results on (upgraded) databases where we do not have expanded arguments, and avoid having to write case distinctions in places where we would want to use `getExpandedArgument`.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user