From patchwork Wed Apr 3 16:26:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 87988 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 E5EDE3844752 for ; Wed, 3 Apr 2024 16:28:00 +0000 (GMT) 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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5F9BC3847718 for ; Wed, 3 Apr 2024 16:26:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5F9BC3847718 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5F9BC3847718 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712161583; cv=none; b=OpbbN+MfnK9JszHBqpzI123GrhY4uk/tSFjY7UqjjzzdU0ARHclNs3nI1RWRUeHvmeMrytZRNdV4WHrGa+RXwDLOBIvifmk6jWeS7pu9N/6j3IudipZd8L3OHUNQNGtcVyCHrRpvLnJOZJHo1bnxLhQt1NYGFXDnqTE0NGQrYG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712161583; c=relaxed/simple; bh=2AAyx4qqVaCGMo50xrSXWPykv0vv1iaiMgtnSk5RpmU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ohB+zmKepdxBYgkUBkgEdv0wouDOf3DBHWIq8GC44wqyL1bHOCj1wAonJtXNsNA+OEeXOn3DHi7sVLxzTPRTXMGeCO9Zedygb67+c7Ah1JhVCOYEy+7BOKTo7joT5CXz0KzbCzVtCo1HBbGwf8ICND+ud3/pi9J4GuMc5mX06o8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712161581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=6MJNqM9hvCtG0bSIyXFry/wnrZhoK+2Y5NXcsJLFd14=; b=aF2eA5iKv0KUowyEAOBC524yUai5mEhcWZl4RfQOlXOMQcHXc6yYu04zZkuv2JMm7B+CnO pHazFlmzrDE6k/GlnlSdG1fsniKbwGEfPzTrCdO8CyrImTp2t27i4ahsC+6hk71MlTeKlk R2whvHDN5QSGsnBJGmISsdW+Q0zRZlg= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-bIWV2eTqO_SwnXAJ4eZCuA-1; Wed, 03 Apr 2024 12:26:19 -0400 X-MC-Unique: bIWV2eTqO_SwnXAJ4eZCuA-1 Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-6e686728cc6so18413a34.2 for ; Wed, 03 Apr 2024 09:26:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712161579; x=1712766379; h=mime-version:user-agent:message-id:date:organization:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6MJNqM9hvCtG0bSIyXFry/wnrZhoK+2Y5NXcsJLFd14=; b=l4XK9e2mqYlgQmn/CUOAlP/2GB54SMRa223dPkw6Ev88gUHJZLwBxg0yJQzK/smFPX 0YHCfyHYf5Oy88hNxgsW3PBrFaFsDijy09UmLDqEr7kosdcm6IA9uYqfBusGCPOytOGz JkbplBRIlN3dxH5//mgMl8PugvWQDNLZVYPxmIa12w/u3LAesasJFuQKEs1R4fALqFzk cTtjhB66j5x2BDKfup93pLa114Jrdlt0zSnv3RLPg4UXpOY2OYN6bLKpkMVgXj66jvKM PiIQ8mhSA6zz49cPwl2ygEEOhNrvm88O5gPkBu6N5Y7pORc7VC3GURfrucHJtU3dZZ43 yYLQ== X-Gm-Message-State: AOJu0Yy2kOpIGL2b3ktmbqXlmA2GQVML2jtlD1ft6cVk/7DP5pOcDacs j0+ahEd2LgssHPicJ6nkFeOkuv0mNNZ1WLifWtHz4K3RJ30NAQ3driPTUAcFsLhGiiBJDyjrktC 9f/wbCzcWqgBkZ0hhCf4BUQhMV+J8+RPHIzbtuX1BAL0lU/NWMGbK/DNahCRBrTLpUw== X-Received: by 2002:a9d:7585:0:b0:6e6:99da:8944 with SMTP id s5-20020a9d7585000000b006e699da8944mr3005304otk.26.1712161578823; Wed, 03 Apr 2024 09:26:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMa+446LA86MTzwjcvQgZRURrUlrRPzK2ztlYqP9JLCLeiqLW6rFXRZggurPzqJB6819tqRg== X-Received: by 2002:a9d:7585:0:b0:6e6:99da:8944 with SMTP id s5-20020a9d7585000000b006e699da8944mr3005283otk.26.1712161578501; Wed, 03 Apr 2024 09:26:18 -0700 (PDT) Received: from localhost (88-120-130-27.subs.proxad.net. [88.120.130.27]) by smtp.gmail.com with ESMTPSA id gc15-20020a056214230f00b00690fc99a836sm6523276qvb.105.2024.04.03.09.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 09:26:17 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 04B1A5077C72; Wed, 3 Apr 2024 18:26:14 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Cc: quic_jiafan@quicinc.com Subject: [PATCH, applied] Bug 31513 - Fix fallout of initial patch Organization: Red Hat / France X-Operating-System: AlmaLinux 9.3 X-URL: http://www.redhat.com Date: Wed, 03 Apr 2024 18:26:13 +0200 Message-ID: <87edbmwgyi.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 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_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, As Jianfeng Fan pointed out in a comment at https://sourceware.org/bugzilla/show_bug.cgi?id=31513#c14, there is a thinko in commit https://sourceware.org/git/?p=libabigail.git;a=commit;h=338394f5454990c715b52bb4bc2ed47b39d6528b. has_subtype_changes forgets to reset the s_member when f_member is reset. Both variables should be reset in tandem, just like what is done in has_offset_changes. Fixed thus. * src/abg-comp-filter.cc (has_subtype_changes): Reset s_member in the loop, just like f_member. * tests/data/test-abidiff-exit/PR31513/non-regr/report1.txt: Adjust. * tests/data/test-abidiff-exit/PR31513/non-regr/report2.txt: Adjust. * tests/test-abidiff-exit.cc (in_out_specs): Adjust. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-comp-filter.cc | 2 +- .../test-abidiff-exit/PR31513/non-regr/report1.txt | 11 +---------- .../test-abidiff-exit/PR31513/non-regr/report2.txt | 11 +---------- tests/test-abidiff-exit.cc | 4 ++-- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/abg-comp-filter.cc b/src/abg-comp-filter.cc index caea9d0c..2156fad0 100644 --- a/src/abg-comp-filter.cc +++ b/src/abg-comp-filter.cc @@ -331,12 +331,12 @@ has_subtype_changes(const string_decl_base_sptr_map& f_data_members, diff_context_sptr ctxt) { // Now compare the offsets of the data members collected. - var_decl_sptr s_member; for (auto entry : f_data_members) { var_decl_sptr f_member = is_var_decl(entry.second); ABG_ASSERT(f_member); + var_decl_sptr s_member; auto i = s_data_members.find(entry.first); if (i == s_data_members.end()) { diff --git a/tests/data/test-abidiff-exit/PR31513/non-regr/report1.txt b/tests/data/test-abidiff-exit/PR31513/non-regr/report1.txt index dff216f8..9666a8fd 100644 --- a/tests/data/test-abidiff-exit/PR31513/non-regr/report1.txt +++ b/tests/data/test-abidiff-exit/PR31513/non-regr/report1.txt @@ -1,12 +1,3 @@ -Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable -1 function with some indirect sub-type change: - - [C] 'function int foo(type&)' at test1-v0.cc:10:1 has some indirect sub-type changes: - parameter 1 of type 'type&' has sub-type changes: - in referenced type 'struct type' at test1-v1.cc:8:1: - type size hasn't changed - 1 base class insertion: - struct base at test1-v1.cc:2:1 - diff --git a/tests/data/test-abidiff-exit/PR31513/non-regr/report2.txt b/tests/data/test-abidiff-exit/PR31513/non-regr/report2.txt index 25d39e9b..9666a8fd 100644 --- a/tests/data/test-abidiff-exit/PR31513/non-regr/report2.txt +++ b/tests/data/test-abidiff-exit/PR31513/non-regr/report2.txt @@ -1,12 +1,3 @@ -Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable -1 function with some indirect sub-type change: - - [C] 'function int foo(type&)' at test2-v0.cc:10:1 has some indirect sub-type changes: - parameter 1 of type 'type&' has sub-type changes: - in referenced type 'struct type' at test2-v1.cc:9:1: - type size hasn't changed - 1 base class insertion: - struct base at test2-v1.cc:2:1 - diff --git a/tests/test-abidiff-exit.cc b/tests/test-abidiff-exit.cc index 104d0580..29df74ff 100644 --- a/tests/test-abidiff-exit.cc +++ b/tests/test-abidiff-exit.cc @@ -1331,7 +1331,7 @@ InOutSpec in_out_specs[] = "", "", "--no-default-suppression", - abigail::tools_utils::ABIDIFF_ABI_CHANGE, + abigail::tools_utils::ABIDIFF_OK, "data/test-abidiff-exit/PR31513/non-regr/report1.txt", "output/test-abidiff-exit/PR31513/non-regr/report1.txt" }, @@ -1346,7 +1346,7 @@ InOutSpec in_out_specs[] = "", "", "--no-default-suppression", - abigail::tools_utils::ABIDIFF_ABI_CHANGE, + abigail::tools_utils::ABIDIFF_OK, "data/test-abidiff-exit/PR31513/non-regr/report2.txt", "output/test-abidiff-exit/PR31513/non-regr/report2.txt" },