[cfe-commits] r157478 - in /cfe/trunk: lib/StaticAnalyzer/Core/ExprEngineC.cpp test/Analysis/cxx11-crashes.cpp
Anna Zaks
ganna at apple.com
Fri May 25 09:02:16 PDT 2012
Author: zaks
Date: Fri May 25 11:02:16 2012
New Revision: 157478
URL: http://llvm.org/viewvc/llvm-project?rev=157478&view=rev
Log:
[analyzer] Don't crash on LValBitCast
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp
cfe/trunk/test/Analysis/cxx11-crashes.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp?rev=157478&r1=157477&r2=157478&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp Fri May 25 11:02:16 2012
@@ -279,7 +279,6 @@
case CK_Dependent:
case CK_ArrayToPointerDecay:
case CK_BitCast:
- case CK_LValueBitCast:
case CK_IntegralCast:
case CK_NullToPointer:
case CK_IntegralToPointer:
@@ -378,7 +377,8 @@
case CK_UserDefinedConversion:
case CK_ConstructorConversion:
case CK_VectorSplat:
- case CK_MemberPointerToBoolean: {
+ case CK_MemberPointerToBoolean:
+ case CK_LValueBitCast: {
// Recover some path-sensitivty by conjuring a new value.
QualType resultType = CastE->getType();
if (CastE->isGLValue())
Modified: cfe/trunk/test/Analysis/cxx11-crashes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/cxx11-crashes.cpp?rev=157478&r1=157477&r2=157478&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/cxx11-crashes.cpp (original)
+++ cfe/trunk/test/Analysis/cxx11-crashes.cpp Fri May 25 11:02:16 2012
@@ -57,3 +57,10 @@
bool s[25];
addressof(s);
}
+
+// radar://11487525 Don't crash on CK_LValueBitCast.
+bool begin(double *it) {
+ typedef bool type[25];
+ bool *a = reinterpret_cast<type &>(*( reinterpret_cast<char *>( it )));
+ return *a;
+}
More information about the cfe-commits
mailing list