Re: [PATCH] libstdc++: Check [ptr, end) and [ptr, ptr+n) ranges with _GLIBCXX_ASSERTIONS

2021-10-15 Thread Jonathan Wakely via Gcc-patches
On Fri, 15 Oct 2021 at 06:19, François Dumont wrote: > > On 14/10/21 7:43 pm, Jonathan Wakely wrote: > > On Thu, 14 Oct 2021 at 18:11, François Dumont wrote: > >> Hi > >> > >> On a related subject I am waiting for some feedback on: > >> > >>

Re: [PATCH] libstdc++: Check [ptr,end) and [ptr,ptr+n) ranges with _GLIBCXX_ASSERTIONS

2021-10-14 Thread François Dumont via Gcc-patches
On 14/10/21 7:43 pm, Jonathan Wakely wrote: On Thu, 14 Oct 2021 at 18:11, François Dumont wrote: Hi On a related subject I am waiting for some feedback on: https://gcc.gnu.org/pipermail/libstdc++/2021-August/053005.html I'm concerned that this adds too much overhead for the

Re: [PATCH] libstdc++: Check [ptr, end) and [ptr, ptr+n) ranges with _GLIBCXX_ASSERTIONS

2021-10-14 Thread Jonathan Wakely via Gcc-patches
On Thu, 14 Oct 2021 at 18:11, François Dumont wrote: > > Hi > > On a related subject I am waiting for some feedback on: > > https://gcc.gnu.org/pipermail/libstdc++/2021-August/053005.html I'm concerned that this adds too much overhead for the _GLIBCXX_ASSERTIONS case. It adds function calls

Re: [PATCH] libstdc++: Check [ptr,end) and [ptr,ptr+n) ranges with _GLIBCXX_ASSERTIONS

2021-10-14 Thread François Dumont via Gcc-patches
Hi     On a related subject I am waiting for some feedback on: https://gcc.gnu.org/pipermail/libstdc++/2021-August/053005.html On 11/10/21 6:49 pm, Jonathan Wakely wrote: This enables lightweight checks for the __glibcxx_requires_valid_range and __glibcxx_requires_string_len macros when

[PATCH] libstdc++: Check [ptr,end) and [ptr,ptr+n) ranges with _GLIBCXX_ASSERTIONS

2021-10-11 Thread Jonathan Wakely via Gcc-patches
This enables lightweight checks for the __glibcxx_requires_valid_range and __glibcxx_requires_string_len macros when _GLIBCXX_ASSERTIONS is defined. By using __builtin_object_size we can check whether the end of the range is part of the same object as the start of the range, and detect problems