public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/112569] New: libstdc++-v3/include/ranges:1456: missing check for self-assignment
@ 2023-11-16 13:03 terra at gnome dot org
  2023-11-23 13:56 ` [Bug libstdc++/112569] " rs2740 at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: terra at gnome dot org @ 2023-11-16 13:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112569

            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. 
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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libstdc++/112569] libstdc++-v3/include/ranges:1456: missing check for self-assignment
  2023-11-16 13:03 [Bug libstdc++/112569] New: libstdc++-v3/include/ranges:1456: missing check for self-assignment terra at gnome dot org
@ 2023-11-23 13:56 ` rs2740 at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: rs2740 at gmail dot com @ 2023-11-23 13:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112569

TC <rs2740 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rs2740 at gmail dot com

--- Comment #1 from TC <rs2740 at gmail dot com> ---
This is exactly as it should be. There's no guarantee that self-move-assignment
on the associated range is a no-op, so the cache must be invalidated.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-23 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 13:03 [Bug libstdc++/112569] New: libstdc++-v3/include/ranges:1456: missing check for self-assignment terra at gnome dot org
2023-11-23 13:56 ` [Bug libstdc++/112569] " rs2740 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).