[cfe-commits] r129564 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Douglas Gregor dgregor at apple.com
Fri Apr 15 07:46:20 PDT 2011


On Apr 15, 2011, at 4:21 AM, Benjamin Kramer wrote:

> Author: d0k
> Date: Fri Apr 15 06:21:57 2011
> New Revision: 129564
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=129564&view=rev
> Log:
> Fix mismatched delete.
> 
> Modified:
>    cfe/trunk/lib/Sema/SemaExpr.cpp
> 
> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=129564&r1=129563&r2=129564&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Apr 15 06:21:57 2011
> @@ -772,7 +772,7 @@
>   ExprResult ER = CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc,
>                                              ControllingExpr, Types, Exprs,
>                                              NumAssocs);
> -  delete Types;
> +  delete [] Types;
>   return ER;
> }

It seems like it would be better to just use a reserved() SmallVector here, rather than temporarily allocate from the heap.

	- Doug



More information about the cfe-commits mailing list