]> granicus.if.org Git - clang/commitdiff
CXX [qoi]. Prevent a crash when initializer expression is
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Jan 2015 22:08:10 +0000 (22:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Jan 2015 22:08:10 +0000 (22:08 +0000)
invalid when trying to create temporary copy of the invalid
initializer. rdar://19109967

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227378 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp

index c6d9a544c4bae60a8ddabae540e40387b99a7afc..089746725f3d841e27896d19869c09815a21fb43 100644 (file)
@@ -5063,6 +5063,8 @@ static ExprResult CopyObject(Sema &S,
                              const InitializedEntity &Entity,
                              ExprResult CurInit,
                              bool IsExtraneousCopy) {
+  if (CurInit.isInvalid())
+    return CurInit;
   // Determine which class type we're copying to.
   Expr *CurInitExpr = (Expr *)CurInit.get();
   CXXRecordDecl *Class = nullptr;