aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-12 02:40:37 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-12 02:40:37 +0000
commit507384f0074498b658cc1455dbb912dd95455512 (patch)
tree603eda230612648ff3c51726778552bc89bb71d7
parente8dc53e5857ac1cf65fa4e9d87e3d88d4452b9d4 (diff)
Bail out of MaybeBindToTemporary if the record type is invalid. Test case
is 8.5MB, sorry. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110901 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExprCXX.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 14f4cd10e7..5e43574e00 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -2619,7 +2619,7 @@ Sema::OwningExprResult Sema::MaybeBindToTemporary(Expr *E) {
// That should be enough to guarantee that this type is complete.
// If it has a trivial destructor, we can avoid the extra copy.
CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
- if (RD->hasTrivialDestructor())
+ if (RD->isInvalidDecl() || RD->hasTrivialDestructor())
return Owned(E);
CXXTemporary *Temp = CXXTemporary::Create(Context, LookupDestructor(RD));