Skip to content

Commit 8c17278

Browse files
authored
Merge pull request #1191 from geoffw0/microsoft
CPP: Workaround improvement for File.compiledAsMicrosoft.
2 parents b555f50 + 5e71207 commit 8c17278

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@ class File extends Container, @file {
309309
) or exists(File parent |
310310
parent.compiledAsMicrosoft() and
311311
parent.getAnIncludedFile() = this
312+
) or (
313+
getAbsolutePath().charAt(1) = ":"
314+
// this is not ideal, it detects compilation on a Windows file system
315+
// as a heuristic approximation to compilation with a Microsoft compiler.
316+
) or (
317+
getAbsolutePath().charAt(1) = "/"
312318
)
313319
}
314320

0 commit comments

Comments
 (0)