From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 17AAF3858D28; Thu, 16 Nov 2023 13:03:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17AAF3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700139805; bh=1W2fzsiopTO1sn4U2XKIIUqWzY/tQtSACa/8vHr/RVI=; h=From:To:Subject:Date:From; b=AjEpeYBooeMU/mWJxqytFRFJRWUXmyhnXf0WafqPTtWODAAZXUg6rpU3uIe3p9H6g f+Iq1BF4eUvE75O8niXeeoJaj0QqdnDfeZyGj9nZ+mkU+ZD52LU87IiVhWZtchPGZH LA9BuDUjQa+eVbq3uSsUl3Naiq7u6wNmdSoQG9jw= From: "terra at gnome dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/112569] New: libstdc++-v3/include/ranges:1456: missing check for self-assignment Date: Thu, 16 Nov 2023 13:03:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: terra at gnome dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112569 Bug ID: 112569 Summary: libstdc++-v3/include/ranges:1456: missing check for self-assignment Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: terra at gnome dot org Target Milestone: --- The move assignment operator for _CachedPosition does not check for self-assignment and it is not obviously safe for other reasons.=20 Self-assignment will overwrite _M_offset with the value -1. It's an internal class. I have no idea if this has any externally visible consequences.=