<div dir="ltr">I realize this was changed in a follow-up commit anyway, but for future reference: There's no need (& best to avoid - simpler to read, avoids bugs like this, etc) to conditionalize delete like this. Delete is a no-op on null pointers anyway, so this dtor should just contain an unconditional "delete BdyFrm;"</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 23, 2017 at 6:09 PM George Karpenkov via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: george.karpenkov<br>
Date: Mon Oct 23 18:09:43 2017<br>
New Revision: 316403<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=316403&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=316403&view=rev</a><br>
Log:<br>
[Analyzer] Fix for the memory leak: fix typo in if-statement.<br>
<br>
Modified:<br>
cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp<br>
<br>
Modified: cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp?rev=316403&r1=316402&r2=316403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp?rev=316403&r1=316402&r2=316403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp (original)<br>
+++ cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp Mon Oct 23 18:09:43 2017<br>
@@ -604,7 +604,7 @@ AnalysisDeclContext::~AnalysisDeclContex<br>
}<br>
<br>
AnalysisDeclContextManager::~AnalysisDeclContextManager() {<br>
- if (!BdyFrm)<br>
+ if (BdyFrm)<br>
delete BdyFrm;<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>