r227378 - CXX [qoi]. Prevent a crash when initializer expression is

Fariborz Jahanian fjahanian at apple.com
Wed Jan 28 14:08:10 PST 2015


Author: fjahanian
Date: Wed Jan 28 16:08:10 2015
New Revision: 227378

URL: http://llvm.org/viewvc/llvm-project?rev=227378&view=rev
Log:
CXX [qoi]. Prevent a crash when initializer expression is
invalid when trying to create temporary copy of the invalid
initializer. rdar://19109967

Modified:
    cfe/trunk/lib/Sema/SemaInit.cpp

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=227378&r1=227377&r2=227378&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Wed Jan 28 16:08:10 2015
@@ -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;





More information about the cfe-commits mailing list