r181611 - Allocate memory for the new number of subexpressions. Fixup for r181572

Dmitri Gribenko gribozavr at gmail.com
Fri May 10 10:30:13 PDT 2013


Author: gribozavr
Date: Fri May 10 12:30:13 2013
New Revision: 181611

URL: http://llvm.org/viewvc/llvm-project?rev=181611&view=rev
Log:
Allocate memory for the new number of subexpressions.  Fixup for r181572

Modified:
    cfe/trunk/lib/AST/Expr.cpp

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=181611&r1=181610&r2=181611&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Fri May 10 12:30:13 2013
@@ -3568,8 +3568,8 @@ ShuffleVectorExpr::ShuffleVectorExpr(AST
 void ShuffleVectorExpr::setExprs(ASTContext &C, ArrayRef<Expr *> Exprs) {
   if (SubExprs) C.Deallocate(SubExprs);
 
-  SubExprs = new (C) Stmt* [NumExprs];
   this->NumExprs = Exprs.size();
+  SubExprs = new (C) Stmt*[NumExprs];
   memcpy(SubExprs, Exprs.data(), sizeof(Expr *) * Exprs.size());
 }
 





More information about the cfe-commits mailing list