[cfe-commits] r126007 - in /cfe/trunk: lib/StaticAnalyzer/Core/Environment.cpp test/Analysis/cxx-crashes.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Feb 18 17:08:42 PST 2011
Author: akirtzidis
Date: Fri Feb 18 19:08:41 2011
New Revision: 126007
URL: http://llvm.org/viewvc/llvm-project?rev=126007&view=rev
Log:
[analyzer] Fix crash when analyzing C++ code.
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp
cfe/trunk/test/Analysis/cxx-crashes.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp?rev=126007&r1=126006&r2=126007&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/Environment.cpp Fri Feb 18 19:08:41 2011
@@ -56,6 +56,7 @@
return svalBuilder.makeIntVal(cast<IntegerLiteral>(E));
}
case Stmt::ImplicitCastExprClass:
+ case Stmt::CXXFunctionalCastExprClass:
case Stmt::CStyleCastExprClass: {
// We blast through no-op casts to get the descendant
// subexpression that has a value.
@@ -75,9 +76,6 @@
case Stmt::CXXBindTemporaryExprClass:
E = cast<CXXBindTemporaryExpr>(E)->getSubExpr();
continue;
- case Stmt::CXXFunctionalCastExprClass:
- E = cast<CXXFunctionalCastExpr>(E)->getSubExpr();
- continue;
// Handle all other Stmt* using a lookup.
default:
break;
Modified: cfe/trunk/test/Analysis/cxx-crashes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/cxx-crashes.cpp?rev=126007&r1=126006&r2=126007&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/cxx-crashes.cpp (original)
+++ cfe/trunk/test/Analysis/cxx-crashes.cpp Fri Feb 18 19:08:41 2011
@@ -6,6 +6,10 @@
return !(q >= p);
}
+long f2(char *c) {
+ return long(c) & 1;
+}
+
namespace {
struct A { };
More information about the cfe-commits
mailing list