diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-11-11 06:43:42 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-11-11 06:43:42 +0000 |
commit | 04552cbef008efe6f5d660da7a97592962f97a2e (patch) | |
tree | 614f200692dfe534f4ba62656a477e72697d459c /clang/lib/Analysis/CastToStructChecker.cpp | |
parent | 55d59bf785289cab52591344a284489351b7646a (diff) | |
download | bcm5719-llvm-04552cbef008efe6f5d660da7a97592962f97a2e.tar.gz bcm5719-llvm-04552cbef008efe6f5d660da7a97592962f97a2e.zip |
CastToStructChecker: use 'isStructureType()' instead of 'isRecordType()' to determine if a pointer is casted to a struct pointer. This fixes an observed false positive when a value is casted to a union.
llvm-svn: 86813
Diffstat (limited to 'clang/lib/Analysis/CastToStructChecker.cpp')
-rw-r--r-- | clang/lib/Analysis/CastToStructChecker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CastToStructChecker.cpp b/clang/lib/Analysis/CastToStructChecker.cpp index 5d0110e4eb2..bda8ff47bf8 100644 --- a/clang/lib/Analysis/CastToStructChecker.cpp +++ b/clang/lib/Analysis/CastToStructChecker.cpp @@ -50,7 +50,7 @@ void CastToStructChecker::PreVisitCastExpr(CheckerContext &C, QualType OrigPointeeTy = OrigPTy->getPointeeType(); QualType ToPointeeTy = ToPTy->getPointeeType(); - if (!ToPointeeTy->isRecordType()) + if (!ToPointeeTy->isStructureType()) return; // We allow cast from void*. |