From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from outbound-ss-820.bluehost.com (outbound-ss-820.bluehost.com [69.89.24.241]) by sourceware.org (Postfix) with ESMTPS id 8CBC5385841B for ; Tue, 20 Jun 2023 17:12:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8CBC5385841B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw11.mail.unifiedlayer.com (unknown [10.0.90.126]) by progateway2.mail.pro1.eigbox.com (Postfix) with ESMTP id EEE0C1004BB6C for ; Tue, 20 Jun 2023 17:12:01 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id BetdquEe67y0BBetdq3PQG; Tue, 20 Jun 2023 17:12:01 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=cbEXElPM c=1 sm=1 tr=0 ts=6491dde1 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=of4jigFt-DYA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=6I5d2MoRAAAA:8 a=b7q51gzFWlwCFr9iWHoA:9 a=IjZwj45LgO3ly-622nXo:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MoyC3tcUEkbWWHWNUwEXojCP5v429fUpwGo4Kt8Bw7s=; b=EmzQQQeIn6YpuN2EzTIw5hJI04 ww+fCZuv/upjLN2NhCGgc8tzx3Z5NAQkRBF6U0dcCEOik5STtd7Zmo7Xs+lP4ks6dsQKZwniXfMSR PAEZa90I+5FgYiZEcmerM1Kp8; Received: from 75-166-136-83.hlrn.qwest.net ([75.166.136.83]:54878 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qBetd-0019Vc-CP; Tue, 20 Jun 2023 11:12:01 -0600 From: Tom Tromey To: John Baldwin Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 6/6] Make aop_map 'static' References: <20230619-ax-new-v1-0-b26175d997a9@tromey.com> <20230619-ax-new-v1-6-b26175d997a9@tromey.com> X-Attribution: Tom Date: Tue, 20 Jun 2023 11:12:00 -0600 In-Reply-To: (John Baldwin's message of "Tue, 20 Jun 2023 08:39:31 -0700") Message-ID: <87fs6m2h3z.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.136.83 X-Source-L: No X-Exim-ID: 1qBetd-0019Vc-CP X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-136-83.hlrn.qwest.net (prentzel) [75.166.136.83]:54878 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3019.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "John" == John Baldwin writes: John> Looking around in ax-general.c more, it seems we already do runtime John> validation of potential indices before indexing the array, so I'm not sure John> the assertion adds much value and I'd be tempted to remove aop_last entirely. Yeah, that was my feeling as well. I've changed this patch to just make aop_map static, and split out another patch to remove aop_last. John> BTW, the various other places in ax-general.c that do the assertion are John> all using the expanded form of ARRAY_SIZE and would be a bit more readable John> perhaps if they used ARRAY_SIZE instead. I tacked on a patch to do this. This caught a bug, one of the checks was using '>' rather than '>='. Tom