[llvm] r262682 - Fix a memory leak.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 4 13:41:26 PST 2016
Any chance of using unique_ptr instead?
On Thu, Mar 3, 2016 at 5:18 PM, Easwaran Raman via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: eraman
> Date: Thu Mar 3 19:18:40 2016
> New Revision: 262682
>
> URL: http://llvm.org/viewvc/llvm-project?rev=262682&view=rev
> Log:
> Fix a memory leak.
>
> Modified:
> llvm/trunk/lib/Analysis/InlineCost.cpp
>
> Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=262682&r1=262681&r2=262682&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
> +++ llvm/trunk/lib/Analysis/InlineCost.cpp Thu Mar 3 19:18:40 2016
> @@ -1600,5 +1600,8 @@ BlockFrequencyInfo *BlockFrequencyAnalys
>
> /// \brief Invalidate BlockFrequencyInfo for a function.
> void BlockFrequencyAnalysis::invalidateBlockFrequencyInfo(Function *F) {
> - BFM.erase(F);
> + if (BFM.count(F)) {
> + delete BFM[F];
> + BFM.erase(F);
> + }
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160304/0a3994a7/attachment.html>
More information about the llvm-commits
mailing list