<div dir="ltr"><div dir="ltr">Hi Geoff,<div><br></div><div>Thanks for catching that. I think your fix is the right one. I have committed it in r342783.</div><div><br></div><div>Cheers,</div><div>Lang.</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 20, 2018 at 12:29 PM Alex Denisov <<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">/cc Lang<br>
<br>
> On 18. Sep 2018, at 10:36, Geoff Levner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> <br>
> In certain circumstances, RTDyldObjectLinkingLayer dereferences a null<br>
> pointer. Specifically, that happens if you add a linking object which,<br>
> for some reason, is never finalized, and you specify a function to be<br>
> called when objects are freed. Admittedly, that must not happen very<br>
> often, but it can happen in our application, causing it to crash.<br>
> <br>
> Might I suggest the following patch?<br>
> <br>
> Geoff<br>
> <br>
> --- RTDyldObjectLinkingLayer.h  (revision 342448)<br>
> +++ RTDyldObjectLinkingLayer.h  (working copy)<br>
> @@ -175,7 +175,7 @@<br>
>     }<br>
> <br>
>     ~ConcreteLinkedObject() override {<br>
> -      if (this->Parent.NotifyFreed)<br>
> +      if (this->Parent.NotifyFreed && ObjForNotify.getBinary())<br>
>         this->Parent.NotifyFreed(K, *ObjForNotify.getBinary());<br>
> <br>
>       MemMgr->deregisterEHFrames();<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div>