From c3ec7b55b7f6fb8e3774639ce121dde05e88e1a0 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 2 Apr 2019 11:40:10 +0100 Subject: [PATCH 1/2] CPP: Workaround improvement for File.compiledAsMicrosoft. --- cpp/ql/src/semmle/code/cpp/File.qll | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/ql/src/semmle/code/cpp/File.qll b/cpp/ql/src/semmle/code/cpp/File.qll index 28f53cbf6033..0e1048023152 100644 --- a/cpp/ql/src/semmle/code/cpp/File.qll +++ b/cpp/ql/src/semmle/code/cpp/File.qll @@ -309,6 +309,10 @@ class File extends Container, @file { ) or exists(File parent | parent.compiledAsMicrosoft() and parent.getAnIncludedFile() = this + ) or ( + getAbsolutePath().charAt(1) = ":" + // this is not ideal, it detects compilation on a Windows file system + // as a heuristic approximation to compilation with a Microsoft compiler. ) } From 5e71207a23f15bd4bdee96701e83b0c75ebbef5e Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 4 Apr 2019 14:32:22 +0100 Subject: [PATCH 2/2] CPP: Add '/' case. --- cpp/ql/src/semmle/code/cpp/File.qll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/ql/src/semmle/code/cpp/File.qll b/cpp/ql/src/semmle/code/cpp/File.qll index 0e1048023152..221093977046 100644 --- a/cpp/ql/src/semmle/code/cpp/File.qll +++ b/cpp/ql/src/semmle/code/cpp/File.qll @@ -313,6 +313,8 @@ class File extends Container, @file { getAbsolutePath().charAt(1) = ":" // this is not ideal, it detects compilation on a Windows file system // as a heuristic approximation to compilation with a Microsoft compiler. + ) or ( + getAbsolutePath().charAt(1) = "/" ) }