Skip to content

Commit bb67ac9

Browse files
authored
Merge pull request #1219 from geoffw0/msfix2
CPP: Fix FormatLiteral.isMicrosoft
2 parents 79e01a2 + 4cc23cc commit bb67ac9

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ class File extends Container, @file {
298298
none()
299299
}
300300

301-
/** Holds if this file was compiled by a Microsoft compiler (at any point). */
301+
/**
302+
* Holds if this file was compiled by a Microsoft compiler (at any point).
303+
*
304+
* Note: currently unreliable - on some projects only some of the files that
305+
* are compiled by a Microsoft compiler are detected by this predicate.
306+
*/
302307
predicate compiledAsMicrosoft() {
303308
exists(Compilation c |
304309
c.getAFileCompiled() = this and

cpp/ql/src/semmle/code/cpp/commons/Printf.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class FormatLiteral extends Literal {
250250
* Microsoft rules and extensions.
251251
*/
252252
predicate isMicrosoft() {
253-
getFile().compiledAsMicrosoft()
253+
any(File f).compiledAsMicrosoft()
254254
}
255255

256256
/**

cpp/ql/src/semmle/code/cpp/models/interfaces/FormattingFunction.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ abstract class FormattingFunction extends Function {
5151
* Microsoft rules and extensions.
5252
*/
5353
predicate isMicrosoft() {
54-
getFile().compiledAsMicrosoft()
54+
any(File f).compiledAsMicrosoft()
5555
}
5656

5757
/**

0 commit comments

Comments
 (0)