From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 750553858298 for ; Fri, 24 Jun 2022 09:06:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 750553858298 Received: by mail-ej1-x62e.google.com with SMTP id u12so3350878eja.8 for ; Fri, 24 Jun 2022 02:06:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=IhnpDUmFkMwlCuoQ3iFlV1yRD04YpCtmBYEUMExNIHg=; b=oNxvMBTboW5cPxVvheJp3GmKJKg/kLZ4z9Pc9wYUOnVnO013SUMzmKhS4oXOhuIeYW /MxX4TM2vRGGN+6sD9nqwb3+CHDZD5hId6LBQzsBb9iK30LbHl0SAZBNZDwdLXUQr9hm kjVQU9n0HaFW9V2ykq/zSyIrqJ+iZnmYalndrGfHGJXcRYioBh2i4yRGvRvwVwn/Oozu +hJKb3goOnrPZwSItAoYO2TaMX+4jOXIGorzajtQdYNnUUw37kFLnPvhF7/G2BRiT6pE U92FUxgshs9+rGoMUofjztVE/JMplpk1ddBibjRGrXpegGTdhfW/tNKSmNsgy/ELBtFl UfAw== X-Gm-Message-State: AJIora9LzKoavwtB3o85N5gb6jDZDC+hBvCujnFJtnNBDAqzugtN0hLG EeEcPBIO7VUk9hawNEn649Jq4FMolo6lmknjS5s= X-Google-Smtp-Source: AGRyM1v/9UfSRqCXHa9M5hGeY8EenEzWh5q3Z7sAGTjdRXx0u39NsHNFFJG2A/VPpFfB6f8tyqvstlu1NdF2ndsl5jw= X-Received: by 2002:a17:906:106:b0:722:e997:a365 with SMTP id 6-20020a170906010600b00722e997a365mr12134211eje.169.1656061581148; Fri, 24 Jun 2022 02:06:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: cauldwell.thomas@gmail.com From: Frederick Virchanza Gotham Date: Fri, 24 Jun 2022 10:06:10 +0100 Message-ID: Subject: Re: string::iterator should have more error checking To: Jonathan Wakely Cc: "libstdc++" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 09:06:24 -0000 On Thu, Jun 23, 2022 at 11:36 PM Jonathan Wakely wrote: > Yes it does: > https://godbolt.org/z/hYhcfjTWY You're right, that does work. I've put together another little sample program. The dereferencing of an "end()" iterator is flagged by __gnu_debug::_Safe_iterator, however the invalid memory access on the last line -- strangely -- is not noticed by "-fsanitize" https://godbolt.org/z/4nzjGG8o3