From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 71EE71F8C6 for ; Sat, 31 Jul 2021 20:33:04 +0000 (UTC) Received: from localhost ([::1]:34322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9vfL-00024P-8Q for normalperson@yhbt.net; Sat, 31 Jul 2021 16:33:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9vfH-00021N-RR for bug-gnulib@gnu.org; Sat, 31 Jul 2021 16:32:59 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9vfF-0001R5-PP for bug-gnulib@gnu.org; Sat, 31 Jul 2021 16:32:59 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 021241600EB for ; Sat, 31 Jul 2021 13:32:54 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id liluc3qxJ-Bf; Sat, 31 Jul 2021 13:32:53 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3DB4C1600DB; Sat, 31 Jul 2021 13:32:53 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Jgo2s_caV1kA; Sat, 31 Jul 2021 13:32:53 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1D486160083; Sat, 31 Jul 2021 13:32:53 -0700 (PDT) From: Paul Eggert To: bug-gnulib@gnu.org Subject: [PATCH] regex: pacify GCC 11.2 -fanalyzer Date: Sat, 31 Jul 2021 13:32:47 -0700 Message-Id: <20210731203247.391949-1-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Eggert Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" * lib/regex_internal.c (re_node_set_insert): Add a debug assertion to pacify GCC 11.2 -fanalyzer. --- ChangeLog | 4 ++++ lib/regex_internal.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 80bcabd22..e3b868f91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2021-07-31 Paul Eggert =20 + regex: pacify GCC 11.2 -fanalyzer + * lib/regex_internal.c (re_node_set_insert): + Add a debug assertion to pacify GCC 11.2 -fanalyzer. + maint: pacify GCC 11.2 -fanalyzer in crypto tests * tests/bench-digest.h (main): Report an error after memory exhaustion, instead of using a null pointer. diff --git a/lib/regex_internal.c b/lib/regex_internal.c index 55f6b66de..6f755b214 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -1286,7 +1286,10 @@ re_node_set_insert (re_node_set *set, Idx elem) =20 if (__glibc_unlikely (set->nelem) =3D=3D 0) { - /* We already guaranteed above that set->alloc !=3D 0. */ + /* Although we already guaranteed above that set->alloc !=3D 0 and + therefore set->elems !=3D NULL, add a debug assertion to pacify + GCC 11.2 -fanalyzer. */ + DEBUG_ASSERT (set->elems); set->elems[0] =3D elem; ++set->nelem; return true; --=20 2.31.1