From patchwork Tue May 25 09:57:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 43562 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43D033857820; Tue, 25 May 2021 09:57:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43D033857820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621936658; bh=iu8esQntM1zZgboRM8n37RE4y3xAhq0kQU6/iTO5rJk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=E6Bim8lxp//ppTZg3kJ+pm4STLc+5XVqoSIlQdcA/0Nan9FaZBooROyDHp56EUvPL 5hVAt0/r27gmQsIq707qkB+idp9Tb7S8ldLZETXaKqNqsTgJoKwxtlbE8EdQRsOy8d Ioo0AZCzRSrodQ55d8IjrEvgpsZg3eJ1BYqVKmO4= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 535E03857820 for ; Tue, 25 May 2021 09:57:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 535E03857820 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-53-nJOjqw5uMKuZg3G68EbZoA-1; Tue, 25 May 2021 05:57:34 -0400 X-MC-Unique: nJOjqw5uMKuZg3G68EbZoA-1 Received: by mail-wm1-f69.google.com with SMTP id h18-20020a05600c3512b029018434eb1bd8so1548178wmq.2 for ; Tue, 25 May 2021 02:57:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=iu8esQntM1zZgboRM8n37RE4y3xAhq0kQU6/iTO5rJk=; b=oi78gcs0ep95sussNDaIe66L391+qgnilQCRn+LNgTV2XiHmEOVSZSSZN+orZ/X5D6 dkyb4ZBOFRO5cIaK4YBBKmxK7xLdwLqgG91vMdakunduM2fqL8cScxzNBAtO3Efq6O2H mp6aVJbMcNDWnwqEFIqBDQV/vobc/OFiAns2ISAfFuywBADolUzPKxbHiKny0cugoPNM CXxc2vmwXW+IUoZZx514NLfM5EMcNwcSCt3bXvhSn+kE81Q2ABuyVWjsTUwQjRRpzuQO u5BbO9Z+mSADxogYXtnUadE3PbXFNXo8IkPe+ftTb2/WayebzaV+vEPt5QpKC+Kq/yJq eAIQ== X-Gm-Message-State: AOAM531Nb0r77LrnqAT8n65k1yBmboX6xmqC80Jy53Uxs57Z8//jlX2p 9ONEhQOQkNxNzfw6Uv0IrHZfgHAzHzkHTsVUVCOM0KErUGhJmZ4OwpQjcdWS4KessA5fGhxVcUi 3NGTI65C5l9RBX5G4WZJ9ufmFVf0v0GTc6KPTL/bnT/DD6girxXFkISfDHxocBX9neKyr X-Received: by 2002:a1c:98c6:: with SMTP id a189mr3053882wme.178.1621936652816; Tue, 25 May 2021 02:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqxcLHEokOj7YPRBVdwVLsOL/qE7VPgfZ9DXB0m5XgxoXxIn9ZxDtNNPrhZHmbRKBgWNzp3w== X-Received: by 2002:a1c:98c6:: with SMTP id a189mr3053865wme.178.1621936652571; Tue, 25 May 2021 02:57:32 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id t5sm2202444wmi.32.2021.05.25.02.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 02:57:32 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 32F0458000E; Tue, 25 May 2021 11:57:31 +0200 (CEST) To: libabigail@sourceware.org Subject: [PATCH, applied] Fix DWARF type DIE canonicalization Organization: Red Hat / France X-Operating-System: Fedora 35 X-URL: http://www.redhat.com Date: Tue, 25 May 2021 11:57:31 +0200 Message-ID: <878s435e5w.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" Hello, While looking at something else, I noticed that the DWARF type DIE canonicalization code wasn't taking the type of array elements into account when comparing arrays. This patch fixes that. * src/abg-dwarf-reader.cc (compare_dies): When comparing array type DIEs, take into account the type of the elements of the arrays. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-dwarf-reader.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index dd9d689c..735a4b48 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -10247,6 +10247,16 @@ compare_dies(const read_context& ctxt, } if (found_l_child != found_r_child) result = false; + // Compare the types of the elements of the array. + Dwarf_Die ltype_die, rtype_die; + bool found_ltype = die_die_attribute(l, DW_AT_type, ltype_die); + bool found_rtype = die_die_attribute(r, DW_AT_type, rtype_die); + ABG_ASSERT(found_ltype && found_rtype); + + if (!compare_dies(ctxt, <ype_die, &rtype_die, + aggregates_being_compared, + update_canonical_dies_on_the_fly)) + return false; } break;