From f338a4f0d66d5877b3b0608bbe3d4fef2e4742c9 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 23 Nov 2018 16:29:39 +0000 Subject: [PATCH] CPP: Fix false positive from AutoGeneratedFile.qll. --- cpp/ql/src/semmle/code/cpp/AutogeneratedFile.qll | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/ql/src/semmle/code/cpp/AutogeneratedFile.qll b/cpp/ql/src/semmle/code/cpp/AutogeneratedFile.qll index 74f8bdd5b7d5..777cc13c1c92 100644 --- a/cpp/ql/src/semmle/code/cpp/AutogeneratedFile.qll +++ b/cpp/ql/src/semmle/code/cpp/AutogeneratedFile.qll @@ -19,7 +19,10 @@ predicate hasPragmaDifferentFile(File f) { exists (PreprocessorLine pl, string s | pl.getFile() = f and pl.getHead().splitAt(" ", 1) = s and /* Zero index is line number, one index is file reference */ - not ("\"" + f.getAbsolutePath() + "\"" = s)) + not ("\"" + f.getAbsolutePath() + "\"" = s) and + not ("\"" + f.getRelativePath() + "\"" = s) and + not ("\"" + f.getBaseName() + "\"" = s) + ) } /**