Skip to content

Commit 47a0d22

Browse files
author
dilanbhalla
committed
Merge branch 'main' of https://github.com/microsoft/codeql into auto/sync-main-pr
2 parents 10b13f2 + 676c6b2 commit 47a0d22

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cpp/ql/src/Microsoft/Likely Bugs/SizeOfMisuse/ArgumentIsSizeofOrOperation.ql

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ predicate isIgnorableBinaryOperation(BinaryOperation op) {
2424
zeroOperand.getExplicitlyConverted().getUnspecifiedType() = t and
2525
// often 'NULL' is defined as (void *)0, ignore these cases
2626
not t instanceof VoidPointerType and
27-
(
28-
// Apparently derived types, eg., functoin pointers, aren't PointerType
29-
// according to codeql, so special casing them out here.
30-
other.getUnspecifiedType() instanceof DerivedType
31-
or
32-
other.getUnspecifiedType() instanceof PointerType
33-
)
27+
// Note Function pointers are not considered PointerType
28+
// casting a wider net here and saying the 'other' cannot be a
29+
// derived type, which is probably too wide, but I think anything
30+
//loosely matching this pattern should be ignored.
31+
other.getUnspecifiedType() instanceof DerivedType
3432
)
3533
}
3634

0 commit comments

Comments
 (0)