[llvm] r237072 - Fixing memory leak

David Blaikie dblaikie at gmail.com
Mon May 11 19:48:21 PDT 2015


On Mon, May 11, 2015 at 5:13 PM, Andrew Kaylor <andrew.kaylor at intel.com>
wrote:

> Author: akaylor
> Date: Mon May 11 19:13:51 2015
> New Revision: 237072
>
> URL: http://llvm.org/viewvc/llvm-project?rev=237072&view=rev
> Log:
> Fixing memory leak
>
> Modified:
>     llvm/trunk/lib/CodeGen/WinEHPrepare.cpp
>
> Modified: llvm/trunk/lib/CodeGen/WinEHPrepare.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/WinEHPrepare.cpp?rev=237072&r1=237071&r2=237072&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/WinEHPrepare.cpp (original)
> +++ llvm/trunk/lib/CodeGen/WinEHPrepare.cpp Mon May 11 19:13:51 2015
> @@ -882,7 +882,9 @@ bool WinEHPrepare::prepareExceptionHandl
>          Function *Handler = cast<Function>(CA->getHandlerBlockOrFunc());
>          getPossibleReturnTargets(&F, Handler, ReturnTargets);
>        }
> +      delete Action;
>

Any chance of using unique_ptr?


>      }
> +    ActionList.clear();
>

& in the ActionList?


>      for (BasicBlock *Target : ReturnTargets) {
>        Branch->addDestination(Target);
>        // The target may be a block that we excepted to get pruned.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150511/6df39ee8/attachment.html>


More information about the llvm-commits mailing list