[llvm] r327359 - [LTO] Return proper error object rather than null LTOModule

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 09:45:17 PDT 2018


Given that you were fixing a crash - that speaks to the existence of a test
failure? But perhaps only in a linker-plugin situation & that's what's
proving difficult to port into the LLVM test environment?

I'd suggest checking to see if llvm-lto2 can reproduce the same codepath &
failure, perhaps?

On Mon, Mar 19, 2018 at 9:43 AM Adam Nemet <anemet at apple.com> wrote:

> I of course thought about that but I don’t know how.  I was trying to get
> inspiration from the large patch that added the buggy code in r254721 but
> that didn’t add a single testcase either :(.  I am open to hear ideas...
>
> On Mar 19, 2018, at 9:23 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
> Test case?
>
> On Mon, Mar 12, 2018 at 9:39 PM Adam Nemet via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: anemet
>> Date: Mon Mar 12 21:37:01 2018
>> New Revision: 327359
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=327359&view=rev
>> Log:
>> [LTO] Return proper error object rather than null LTOModule
>>
>> This caused a crash in LTOModule::createInLocalContext.
>>
>> rdar://37926841
>>
>> Modified:
>>     llvm/trunk/lib/LTO/LTOModule.cpp
>>
>> Modified: llvm/trunk/lib/LTO/LTOModule.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=327359&r1=327358&r2=327359&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/LTO/LTOModule.cpp (original)
>> +++ llvm/trunk/lib/LTO/LTOModule.cpp Mon Mar 12 21:37:01 2018
>> @@ -208,7 +208,7 @@ LTOModule::makeLTOModule(MemoryBufferRef
>>    std::string errMsg;
>>    const Target *march = TargetRegistry::lookupTarget(TripleStr, errMsg);
>>    if (!march)
>> -    return std::unique_ptr<LTOModule>(nullptr);
>> +    return make_error_code(object::object_error::arch_not_found);
>>
>>    // construct LTOModule, hand over ownership of module and target
>>    SubtargetFeatures Features;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180319/ab7631d9/attachment.html>


More information about the llvm-commits mailing list