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

Jonathan Wakely jwakely@redhat.com
Thu May 28 14:46:00 GMT 2015


On 28/05/15 12:53 +0100, Jonathan Wakely wrote:
>Unsurprisingly ubsan doesn't like referencing a null pointer.
>
>With this change __array_traits::_S_ref is only used to access an
>element, which is invalid for std::array<T, 0> anyway.
>
>Tested powerpc64le-linux, committed to trunk.

I forgot the debug and profile modes, fixed like so.

1) Why do we even have _profile::array? What's it for?

2) If we could run 'make check-sanitize' I could have added tests for
   this bug, and could have found it still failed in debug and profile
   modes. We need to be able to run the testsuite with ubsan.

I'll commit it to trunk and gcc-5-branch after testing.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1440 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150528/44b1aabf/attachment.bin>


More information about the Libstdc++ mailing list