[PATCH] D80763: [X86] Fix a nullptr defrence in X86Subtarget::classifyLocalReference when compiling with -mcmodel=medium -fpic and using a constant pool

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 17:19:27 PDT 2020


Done.

~Craig


On Thu, May 28, 2020 at 5:06 PM Eric Christopher <echristo at gmail.com> wrote:

> Oh well. Add a comment then? :)
>
> On Thu, May 28, 2020, 3:59 PM Craig Topper via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
>> craig.topper marked an inline comment as done.
>> craig.topper added inline comments.
>>
>>
>> ================
>> Comment at: llvm/lib/Target/X86/X86Subtarget.cpp:91
>>        case CodeModel::Medium:
>> -        if (isa<Function>(GV))
>> +        if (isa_and_nonnull<Function>(GV))
>>            return X86II::MO_NO_FLAG; // All code is RIP-relative
>> ----------------
>> echristo wrote:
>> > Seems reasonable to either comment your commit message here or try to
>> fix the nullptr into classifyLocalReference and assert nonnull?
>> Looks like there are several places that handle constants to that pass
>> null, fastisel, globalisel and regular isel. Also jump tables.
>>
>> This function takes a GlobalValue and constants and jump table don't
>> exist as GlobalValues do they? So I'm not sure how to fix the nullptr input.
>>
>>
>> CHANGES SINCE LAST ACTION
>>   https://reviews.llvm.org/D80763/new/
>>
>> https://reviews.llvm.org/D80763
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200528/3951fc16/attachment.html>


More information about the llvm-commits mailing list