Skip to content

Commit f338a4f

Browse files
committed
CPP: Fix false positive from AutoGeneratedFile.qll.
1 parent dc224c5 commit f338a4f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp/ql/src/semmle/code/cpp/AutogeneratedFile.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ predicate hasPragmaDifferentFile(File f) {
1919
exists (PreprocessorLine pl, string s |
2020
pl.getFile() = f and
2121
pl.getHead().splitAt(" ", 1) = s and /* Zero index is line number, one index is file reference */
22-
not ("\"" + f.getAbsolutePath() + "\"" = s))
22+
not ("\"" + f.getAbsolutePath() + "\"" = s) and
23+
not ("\"" + f.getRelativePath() + "\"" = s) and
24+
not ("\"" + f.getBaseName() + "\"" = s)
25+
)
2326
}
2427

2528
/**

0 commit comments

Comments
 (0)