aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-08-31 18:47:34 +0000
committerTed Kremenek <kremenek@apple.com>2010-08-31 18:47:34 +0000
commita427f1d8f0848997029d1bdc0c5c137f982f775d (patch)
treef228b2bd6d6d42d62decfc189339e29c299fe014
parentf9b949fecf339a2c9bd97dd11a272c4878f85ce4 (diff)
Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat it the same as CallExprs.
Fixes: <rdar://problem/8375510> [Boost] CFGBuilder crash in Boost.Graph git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112618 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/CFG.cpp3
-rw-r--r--test/Analysis/misc-ps-region-store.cpp11
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp
index 78979a4fee..562763b8b4 100644
--- a/lib/Analysis/CFG.cpp
+++ b/lib/Analysis/CFG.cpp
@@ -370,6 +370,7 @@ tryAgain:
return VisitBreakStmt(cast<BreakStmt>(S));
case Stmt::CallExprClass:
+ case Stmt::CXXOperatorCallExprClass:
return VisitCallExpr(cast<CallExpr>(S), asc);
case Stmt::CaseStmtClass:
@@ -393,7 +394,7 @@ tryAgain:
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:
diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp
index baaa2f6cbd..bfa5e5cbb9 100644
--- a/test/Analysis/misc-ps-region-store.cpp
+++ b/test/Analysis/misc-ps-region-store.cpp
@@ -148,3 +148,14 @@ void pr7675_test() {
*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++) { }
+}
+