This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/60734] Undefined behavior in g++-v4/bits/stl_tree.h
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Aug 2015 13:25:22 +0000
- Subject: [Bug libstdc++/60734] Undefined behavior in g++-v4/bits/stl_tree.h
- Auto-submitted: auto-generated
- References: <bug-60734-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60734
--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Bhargava Shastry from comment #12)
> a) and b) together imply that it is possible that _M_right points to an
> object of type _Rb_tree_node_base when cast to _Link_type in [1]. Is this a
> matter for concern?
Not especially, because we never dereference it except when it really does
point to the derived type.
We might be able to replace those with reinterpret_cast, or just return the
base pointer and delay the cast until needed.