This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/60734] Undefined behavior in g++-v4/bits/stl_tree.h


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]