From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 682DB3858D20 for ; Thu, 29 Dec 2022 04:25:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 682DB3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x433.google.com with SMTP id k137so7149993pfd.8 for ; Wed, 28 Dec 2022 20:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=rPSQZqCHHaeCuVKCvIuF/eaaystaqXx3je7BKaf/Alg=; b=Z5UINzA67iPUD+IPQZ/hkv0+qtXAm8lLNjs5ZRvAcDztOLrKFaQd6iFMzlJg//0chD Wr6sVBlN1TO+WMR9fT2vMOF7MtI/Sww04NGNZVAmrKY5dQ1znl87UNxTP/BphUlQzwh5 nehcMy/WcsP3wLAPEQdwxFz5/TZYHD4qSeuT95b0J4pUgc+yGjEzxmlPVDMxizyTc5UL LBsiLtnKTj+cbGqUMek5kk+46SqLPlMk60z4Yph3P53QO4XAwMldNVHWbFpYkvBov7Ah YUTXOdQn1yZpKvyvpGpL4ONvzQN8KNmjs2/ixRHBqrKsaRmuHVtF6IPC7SyoB0YNVayf Oz8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rPSQZqCHHaeCuVKCvIuF/eaaystaqXx3je7BKaf/Alg=; b=J7wYR0oesan3Ihi5X6JFKDU0y1vRRKrqKnC+fBv26DmQjo9nlwLlzkch6ZQ2rXZZ9a fpiVHn6jaGJWcQ8Ic9B6P36IzTEh5HfEw8bGXSXZ+W+PyJ42q5fxYpmjG8T4rnKew0Lm re5aaIeQME7YqykgxC14kWWzjYiGsgAsZrPCBq41YUccaD3sZA5JF1B7Mh9ibTMzMs/y /hGVu/HtqhZ6a2JafCHvxQyOqPLPIY7VqjjHLIBQtV/KSahC/rhLZyfCnro8GucNP9B8 7E/KvK/a3OcQP9q0xB+uB7fDCXINyE01Iygo93vV+HHgBG8sFKhvkzBdWlQDT4zn+J7O szRw== X-Gm-Message-State: AFqh2kr7HUqEc4gHMXpmnaLlRabkZPV/9ltrRs8iWszRqwljNBiCyhhw TxXDUpglTRTmImHKhuf5RsQ= X-Google-Smtp-Source: AMrXdXv4pE7rztOe2Jr86G4r3XGhqTN9wge93cRqkehPAkL426uPYCrKQnSHfzuMlVIR9ZhaSPgo9g== X-Received: by 2002:a62:506:0:b0:56c:7216:fbc6 with SMTP id 6-20020a620506000000b0056c7216fbc6mr28242223pff.30.1672287952346; Wed, 28 Dec 2022 20:25:52 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id x19-20020aa79ad3000000b005811c421e6csm6249023pfp.162.2022.12.28.20.25.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Dec 2022 20:25:51 -0800 (PST) Message-ID: <95883a81-dc76-4732-543d-17cbd9e4b6f5@gmail.com> Date: Wed, 28 Dec 2022 21:25:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [15/17] prevent hash set/map insertion of deleted entries Content-Language: en-US To: Alexandre Oliva , David Malcolm Cc: gcc-patches@gcc.gnu.org References: <613b4501636146942775f23cfa8035f9eb7b84d3.camel@redhat.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 12/28/22 05:32, Alexandre Oliva via Gcc-patches wrote: > On Dec 27, 2022, David Malcolm wrote: > >> Would it make sense to also add assertions that such entries aren't >> Traits::is_deleted? (both for hash_map and hash_set) > > Yeah, I guess so. I've come up with something for hash-table proper > too, coming up in 17/17. > > > Just like the recently-added checks for empty entries, add checks for > deleted entries as well. This didn't catch any problems, but it might > prevent future accidents. Suggested by David Malcolm. > > Regstrapped on x86_64-linux-gnu. Ok to install? > > > for gcc/ChangeLog > > * hash-map.h (put, get_or_insert): Check that added entry > doesn't look deleted either. > & hash-set.h (add): Likewise. OK jeff