[cfe-commits] r125963 - in /cfe/trunk: lib/StaticAnalyzer/Core/AggExprVisitor.cpp test/Analysis/cxx-crashes.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Feb 18 13:24:56 PST 2011
Author: akirtzidis
Date: Fri Feb 18 15:24:56 2011
New Revision: 125963
URL: http://llvm.org/viewvc/llvm-project?rev=125963&view=rev
Log:
[analyzer] Fix crash when analyzing C++ code.
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/AggExprVisitor.cpp
cfe/trunk/test/Analysis/cxx-crashes.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/AggExprVisitor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/AggExprVisitor.cpp?rev=125963&r1=125962&r2=125963&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/AggExprVisitor.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/AggExprVisitor.cpp Fri Feb 18 15:24:56 2011
@@ -39,6 +39,7 @@
void VisitCastExpr(CastExpr *E);
void VisitCXXConstructExpr(CXXConstructExpr *E);
+ void VisitCXXMemberCallExpr(CXXMemberCallExpr *E);
};
}
@@ -48,6 +49,7 @@
assert(0 && "Unhandled cast kind");
case CK_NoOp:
case CK_ConstructorConversion:
+ case CK_UserDefinedConversion:
Visit(E->getSubExpr());
break;
}
@@ -57,6 +59,10 @@
Eng.VisitCXXConstructExpr(E, Dest, Pred, DstSet);
}
+void AggExprVisitor::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
+ Eng.VisitCXXMemberCallExpr(E, Pred, DstSet);
+}
+
void ExprEngine::VisitAggExpr(const Expr *E, const MemRegion *Dest,
ExplodedNode *Pred, ExplodedNodeSet &Dst) {
AggExprVisitor(Dest, Pred, Dst, *this).Visit(const_cast<Expr *>(E));
Modified: cfe/trunk/test/Analysis/cxx-crashes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/cxx-crashes.cpp?rev=125963&r1=125962&r2=125963&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/cxx-crashes.cpp (original)
+++ cfe/trunk/test/Analysis/cxx-crashes.cpp Fri Feb 18 15:24:56 2011
@@ -5,3 +5,17 @@
char *q = dst + 3;
return !(q >= p);
}
+
+namespace {
+
+struct A { };
+struct B {
+ operator A();
+};
+
+A f(char *dst) {
+ B b;
+ return b;
+}
+
+}
More information about the cfe-commits
mailing list