[cfe-commits] r112618 - in /cfe/trunk: lib/Analysis/CFG.cpp test/Analysis/misc-ps-region-store.cpp
Ted Kremenek
kremenek at apple.com
Tue Aug 31 11:47:34 PDT 2010
Author: kremenek
Date: Tue Aug 31 13:47:34 2010
New Revision: 112618
URL: http://llvm.org/viewvc/llvm-project?rev=112618&view=rev
Log:
Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat it the same as CallExprs.
Fixes: <rdar://problem/8375510> [Boost] CFGBuilder crash in Boost.Graph
Modified:
cfe/trunk/lib/Analysis/CFG.cpp
cfe/trunk/test/Analysis/misc-ps-region-store.cpp
Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=112618&r1=112617&r2=112618&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Tue Aug 31 13:47:34 2010
@@ -370,6 +370,7 @@
return VisitBreakStmt(cast<BreakStmt>(S));
case Stmt::CallExprClass:
+ case Stmt::CXXOperatorCallExprClass:
return VisitCallExpr(cast<CallExpr>(S), asc);
case Stmt::CaseStmtClass:
@@ -393,7 +394,7 @@
case Stmt::CXXExprWithTemporariesClass: {
// FIXME: Handle temporaries. For now, just visit the subexpression
// so we don't artificially create extra blocks.
- return Visit(cast<CXXExprWithTemporaries>(S)->getSubExpr());
+ return Visit(cast<CXXExprWithTemporaries>(S)->getSubExpr(), asc);
}
case Stmt::CXXMemberCallExprClass:
Modified: cfe/trunk/test/Analysis/misc-ps-region-store.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.cpp?rev=112618&r1=112617&r2=112618&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.cpp (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.cpp Tue Aug 31 13:47:34 2010
@@ -148,3 +148,14 @@
*p = 0xDEADBEEF; // expected-warning{{null pointer}}
}
+// <rdar://problem/8375510> - CFGBuilder should handle temporaries.
+struct R8375510 {
+ R8375510();
+ ~R8375510();
+ R8375510 operator++(int);
+};
+
+int r8375510(R8375510 x, R8375510 y) {
+ for (; ; x++) { }
+}
+
More information about the cfe-commits
mailing list