[llvm] r267037 - Fix crash in llvm-objdump with -macho -objc-meta-data that was trying dump a non-existent section.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 11:03:11 PDT 2016


Generally a test case would be nice - especially if it's as simple as just
not having a certain section (so it doesn't require a lot of complexity,
etc).

On Thu, Apr 21, 2016 at 12:49 PM, Kevin Enderby via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: enderby
> Date: Thu Apr 21 14:49:29 2016
> New Revision: 267037
>
> URL: http://llvm.org/viewvc/llvm-project?rev=267037&view=rev
> Log:
> Fix crash in llvm-objdump with -macho -objc-meta-data that was trying dump
> a non-existent section.
>
> Showed up in running on a large binary with the missing section.  I could
> create a fake
> test case if anyone really wants but the fix is pretty obvious.
>
> rdar://25837034
>
> Modified:
>     llvm/trunk/tools/llvm-objdump/MachODump.cpp
>
> Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=267037&r1=267036&r2=267037&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
> +++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Apr 21 14:49:29 2016
> @@ -5134,6 +5134,9 @@ static void print_image_info32(SectionRe
>    struct objc_image_info32 o;
>    const char *r;
>
> +  if (S == SectionRef())
> +    return;
> +
>    StringRef SectName;
>    S.getName(SectName);
>    DataRefImpl Ref = S.getRawDataRefImpl();
>
>
> _______________________________________________
> 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/20160422/cba2af14/attachment.html>


More information about the llvm-commits mailing list