From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 8E2783858D28 for ; Mon, 28 Aug 2023 21:10:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E2783858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 37SLApxr000820 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 17:10:56 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 37SLApxr000820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1693257056; bh=l86x1CGtU25B7qSgDWPmHU8rpXNwLbq2gC8OD66njM0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=nzjpJohlPH2X+lcr2XGiw+602GKPSPERLRgp+jYJZGz3FrFTt/R47EtlfqTt4PmcE iU1ZoojSkXD3ViwKDWUt9/g/K5Ar89FkU4+qc6KZAq5M2PSQg0ttdbthOnKNFH7M72 sJD6SdxDiah44r3mx5F04sb4IxIeng2bTljjvA8E= Received: from [10.0.0.170] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 2F85D1E028; Mon, 28 Aug 2023 17:10:51 -0400 (EDT) Message-ID: Date: Mon, 28 Aug 2023 17:10:50 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/5] Use gdb::array_view for value_array Content-Language: fr To: Tom Tromey , gdb-patches@sourceware.org References: <20230828-cleanup-array-op-v1-0-12ca00f20917@adacore.com> <20230828-cleanup-array-op-v1-1-12ca00f20917@adacore.com> From: Simon Marchi In-Reply-To: <20230828-cleanup-array-op-v1-1-12ca00f20917@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 28 Aug 2023 21:10:51 +0000 X-Spam-Status: No, score=-3037.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,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 List-Id: On 8/28/23 15:59, Tom Tromey via Gdb-patches wrote: > diff --git a/gdb/valops.c b/gdb/valops.c > index ea9d9b38e74..1133049c54a 100644 > --- a/gdb/valops.c > +++ b/gdb/valops.c > @@ -1692,7 +1692,8 @@ value_ind (struct value *arg1) > don't currently enforce any restriction on their types). */ > > struct value * > -value_array (int lowbound, int highbound, struct value **elemvec) > +value_array (int lowbound, int highbound, > + gdb::array_view elemvec) > { I suppose it is necessary that "highbound - lowbound + 1" be equal to elemvec.size()? If so, we could add an assert to make sure it's true, or better (IMO), remove highbound. Simon