[Bug libstdc++/96946] libstdc++ std::shared_ptr makes an "unrelated cast" that causes Clang's Control Flow Integrity sanitiser to crash
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Sep 7 14:28:51 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96946
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Libc++ seems to pass the std::list example in comment 3 because they rely on
different UB: https://godbolt.org/z/xvdaxh
The libc++ std::list node is allocated as though it's raw storage, and so is
never constructed. That means they don't need to cast from raw bytes to a T*,
because they just take the address of a T subobject inside an object which
doesn't exist.
More information about the Gcc-bugs
mailing list