[llvm] eb61ab1 - Fix a copy and paste error that would cause a crash.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 18:56:12 PDT 2020


The patch description says it causes a crash - could you please add
separate test coverage for this fix that demonstrates the crash no longer
occurs & tests the behavior that should've been happening instead of the
crash?

Submitting changes without test coverage is a bit problematic & embedding
the tests in another functional change makes it harder to assess whether
the tests cover the right/new/previous functionality, etc.

On Thu, Apr 2, 2020 at 6:50 PM Greg Clayton <gclayton at fb.com> wrote:

> Not yet, test coverage will come with my upcoming patch that enables
> –update to work on ELF files.
>
>
>
> *From: *David Blaikie <dblaikie at gmail.com>
> *Date: *Wednesday, March 25, 2020 at 12:50 PM
> *To: *Greg Clayton <gclayton at fb.com>, Greg Clayton <llvmlistbot at llvm.org>
> *Cc: *llvm-commits <llvm-commits at lists.llvm.org>
> *Subject: *Re: [llvm] eb61ab1 - Fix a copy and paste error that would
> cause a crash.
>
>
>
> Does this have test coverage?
>
>
>
> On Fri, Mar 6, 2020 at 6:07 PM Greg Clayton via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Greg Clayton
> Date: 2020-03-06T18:07:36-08:00
> New Revision: eb61ab1bd9af607fc7439edd3b92467b78772b92
>
> URL:
> https://github.com/llvm/llvm-project/commit/eb61ab1bd9af607fc7439edd3b92467b78772b92
> DIFF:
> https://github.com/llvm/llvm-project/commit/eb61ab1bd9af607fc7439edd3b92467b78772b92.diff
>
> LOG: Fix a copy and paste error that would cause a crash.
>
> Summary: The wrong variable was being checked for an error, which mean a
> llvm::Error went unchecked and crashes dsymutil. Discovered this when
> trying to feed an ELF file to "dsymutil --update" and running into the
> crash.
>
> Reviewers: aprantl, JDevlieghere
>
> Subscribers: llvm-commits
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D75777
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D75777&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=ThRQ77VnKhqKMdoo_7_huw&m=-QqN8drvd_904Cqb5JC6ILIf3nN3DV5pr414AXRAVTo&s=AbBu6TofQozS6_11gbiuShMHwFyB0zNztYWf8Yfz2mo&e=>
>
> Added:
>
>
> Modified:
>     llvm/tools/dsymutil/MachODebugMapParser.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp
> b/llvm/tools/dsymutil/MachODebugMapParser.cpp
> index 83703fb13f0a..a9d6c876860c 100644
> --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp
> +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp
> @@ -383,7 +383,7 @@ ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
> MachODebugMapParser::parse() {
>
>    auto Objects = ObjectEntry->getObjectsAs<MachOObjectFile>();
>    if (!Objects) {
> -    return errorToErrorCode(ObjectEntry.takeError());
> +    return errorToErrorCode(Objects.takeError());
>    }
>
>    std::vector<std::unique_ptr<DebugMap>> Results;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=ThRQ77VnKhqKMdoo_7_huw&m=-QqN8drvd_904Cqb5JC6ILIf3nN3DV5pr414AXRAVTo&s=JTMfjjLwT8sswuAffXt_Qrsbhmf_5D-mV31KPiAtzUo&e=>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200402/71872ead/attachment.html>


More information about the llvm-commits mailing list