llvm-project/clang/lib/StaticAnalyzer/Checkers
Artem Dergachev 02955afbb4 [analyzer] pr38668: Do not attempt to cast loaded integers to floats.
This patch is a different approach to landing the reverted r349701.

It is expected to have the same object (memory region) treated as if it has
different types in different program points. The correct behavior for
RegionStore when an object is stored as an object of type T1 but loaded as
an object of type T2 is to store the object as if it has type T1 but cast it
to T2 during load.

Note that the cast here is some sort of a "reinterpret_cast" (even in C). For
instance, if you store an integer and load a float, you won't get your integer
represented as a float; instead, you will get garbage.

Admit that we cannot perform the cast and return an unknown value.

Differential Revision: https://reviews.llvm.org/D55875

rdar://problem/45062567

llvm-svn: 349984
2018-12-22 02:06:51 +00:00
..
MPI-Checker [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
RetainCountChecker Revert "Revert rL349876 from cfe/trunk: [analyzer] Perform escaping in RetainCountChecker on type mismatch even for inlined functions" 2018-12-21 19:13:40 +00:00
UninitializedObject [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
AllocationState.h [analyzer] InnerPointerChecker: improve warning messages and notes. 2018-08-10 23:56:57 +00:00
AnalysisOrderChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
AnalyzerStatsChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ArrayBoundChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ArrayBoundCheckerV2.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
BasicObjCFoundationChecks.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
BlockInCriticalSectionChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
BoolAssignmentChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
BuiltinFunctionChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CMakeLists.txt [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CStringChecker.cpp [analyzer] CStringChecker: Fix a crash on C++ overloads of standard functions. 2018-12-19 21:50:46 +00:00
CStringSyntaxChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CXXSelfAssignmentChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CallAndMessageChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CastSizeChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CastToStructChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CheckObjCDealloc.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CheckObjCInstMethSignature.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CheckSecuritySyntaxOnly.cpp Replace getOS() == llvm::Triple::*BSD with isOS*BSD() [NFCI] 2018-12-20 13:09:30 +00:00
CheckSizeofPointer.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CheckerDocumentation.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ChrootChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
CloneChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ConversionChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
DeadStoresChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
DebugCheckers.cpp [analyzer] Fix some expressions staying live too long. Add a debug checker. 2018-12-16 23:44:06 +00:00
DeleteWithNonVirtualDtorChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
DereferenceChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
DirectIvarAssignment.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
DivZeroChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
DynamicTypeChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
DynamicTypePropagation.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
EnumCastOutOfRangeChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ExprInspectionChecker.cpp [analyzer] pr38668: Do not attempt to cast loaded integers to floats. 2018-12-22 02:06:51 +00:00
FixedAddressChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
GCDAntipatternChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
GTestChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
GenericTaintChecker.cpp [analyzer] GenericTaint: Fix formatting to prepare for incoming improvements. 2018-12-19 23:35:08 +00:00
IdenticalExprChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
InnerPointerChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
InterCheckerAPI.h [analyzer] InnerPointerChecker: fix displayed checker name. 2018-08-06 22:03:42 +00:00
IteratorChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
IvarInvalidationChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
LLVMConventionsChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
LocalizationChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
MacOSKeychainAPIChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
MacOSXAPIChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
MallocChecker.cpp Revert rC349281 '[analyzer][MallocChecker][NFC] Document and reorganize some functions' 2018-12-17 12:25:48 +00:00
MallocOverflowSecurityChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
MallocSizeofChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
MmapWriteExecChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
MoveChecker.cpp [analyzer] MoveChecker: Squash the bit field because it causes a GCC warning. 2018-12-17 21:07:38 +00:00
NSAutoreleasePoolChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
NSErrorChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
NoReturnFunctionChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
NonNullParamChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
NonnullGlobalConstantsChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
NullabilityChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
NumberObjectConversionChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCAtSyncChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCAutoreleaseWriteChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCContainersASTChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCContainersChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCMissingSuperCallChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCPropertyChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCSelfInitChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCSuperDeallocChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ObjCUnusedIVarsChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
PaddingChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
PointerArithChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
PointerSubChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
PthreadLockChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ReturnPointerRangeChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ReturnUndefChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
RunLoopAutoreleaseLeakChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
SimpleStreamChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
StackAddrEscapeChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
StdLibraryFunctionsChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
StreamChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
TaintTesterChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
TestAfterDivZeroChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
TraversalChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
TrustNonnullChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
UndefBranchChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
UndefCapturedBlockVarChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
UndefResultChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
UndefinedArraySubscriptChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
UndefinedAssignmentChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
UnixAPIChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
UnreachableCodeChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
VLASizeChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
ValistChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
VforkChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00
VirtualCallChecker.cpp [analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend 2018-12-15 16:23:51 +00:00