[llvm] r327359 - [LTO] Return proper error object rather than null LTOModule
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 19 09:43:24 PDT 2018
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 <mailto: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 <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 <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 <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <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/fcf6d616/attachment.html>
More information about the llvm-commits
mailing list