Merge pull request #21514 from geoffw0/suspicioussizeof

C++: Fix an issue with cpp/suspicious-add-sizeof in BMN databases
This commit is contained in:
Geoffrey White
2026-03-20 09:41:39 +00:00
committed by GitHub
5 changed files with 24 additions and 1 deletions

View File

@@ -18,7 +18,8 @@ import IncorrectPointerScalingCommon
private predicate isCharSzPtrExpr(Expr e) {
exists(PointerType pt | pt = e.getFullyConverted().getUnspecifiedType() |
pt.getBaseType() instanceof CharType or
pt.getBaseType() instanceof VoidType
pt.getBaseType() instanceof VoidType or
pt.getBaseType() instanceof ErroneousType // this could be char / void type in a successful compilation
)
}