[PATCH] Fix a couple of use-after-frees in X86ISelDAGToDAG

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 14:16:28 PDT 2016


On Tue, Apr 12, 2016 at 1:46 PM, Justin Bogner <mail at justinbogner.com> wrote:
> Ahmed Bougacha <ahmed.bougacha at gmail.com> writes:
>> Looks like the only uses are DL/VT; maybe just get those earlier (and
>> explain in a comment)?
>
> You're right. The attached works. It's still pretty fragile / easy to
> get wrong obviously, but it's a strict improvement for now.

Yeah, it's a start.. LGTM.

>> Also, I thought SelectionDAGISel.cpp had the same issues.  You do
>> mention ISD::DELETED_NODE in the PR; I guess you have a plan to get
>> rid of that?
>
> The ISD::DELETED_NODE stuff is a little bit more involved, largely since
> the use-after-frees are very intentional there. I've been experimenting
> with ways to clean that up, but I'm fixing up the other places in LLVM
> where we have these problems while I'm at it.

Sounds good; good luck!

-Ahmed

>> -Ahmed
>>
>>
>> On Tue, Apr 12, 2016 at 11:14 AM, Justin Bogner <mail at justinbogner.com> wrote:
>>> While looking at llvm.org/PR26808 I found a couple of use-after-frees in
>>> X86ISelDAGToDAG, where we RAUW a node and then try to keep using it. The
>>> attached patch fixes the tests that crash under ASan, but it feels a bit
>>> targetted and kludgy. I'm afraid a robust fix would involve a lot of
>>> refactoring of how X86ISelDAGToDAG works though, and I certainly won't
>>> be able to do that any time soon.
>>>
>>> Thoughts?
>>>
>


More information about the llvm-commits mailing list