[patch] libstdc++/65352 fix ubsan errors in std::array<T, 0>

Marc Glisse marc.glisse@inria.fr
Thu May 28 14:06:00 GMT 2015


On Thu, 28 May 2015, Jonathan Wakely wrote:

> Would there be a danger of an object compiled with gcc-5.1 that calls
> array<T, 0>::data() finding the _S_ref from an object compiled with
> gcc-5.2 and hitting the __builtin_unreachable in vali code?

At -O0, maybe. To be safe you would need to give this _S_ref an arbitrary 
abi_tag. You could also replace all uses of _S_ref with *_S_ptr.

-- 
Marc Glisse



More information about the Gcc-patches mailing list