On Wed, Apr 22, 2015 at 12:26:57PM +0300, Yury Gribov wrote:
> On 04/22/2015 12:00 PM, Jakub Jelinek wrote:
> >On Wed, Apr 22, 2015 at 11:43:53AM +0300, Yury Gribov wrote:
> >>@@ -272,7 +273,7 @@ along with GCC; see the file COPYING3.  If not see
> >>
> >>  static unsigned HOST_WIDE_INT asan_shadow_offset_value;
> >>  static bool asan_shadow_offset_computed;
> >>-static const char *sanitized_sections;
> >>+static vec<char *, va_gc> *sanitized_sections;
> >
> >Why don't you use static vec<char *> sanitized_section instead?
> 
> Fixed.  I thought we try to avoid creating unnecessary vectors but probably
> not that important.

Sure, we try to avoid global var ctors/dtors and unnecessary unconditional
allocations.  But AFAIK vec<char *> (unlike auto_vec) doesn't have any user
ctor/dtor, it is a POD, and it is basically just
a struct containing that vec<char *, va_heap, vl_embed> * as a sole member,
and the zero initialization of global POD vars arranges for it to be
properly initialized.

>     2015-04-22  Yury Gribov  <y.gri...@samsung.com>
>     
>       gcc/
>       * asan.c (set_sanitized_sections): Parse incoming arg.
>       (section_sanitized_p): Support wildcards.
>       * doc/invoke.texi (-fsanitize-sections): Update description.
>     
>       gcc/testsuite/
>       * c-c++-common/asan/user-section-1.c: New test.
>       * c-c++-common/asan/user-section-2.c: New test.
>       * c-c++-common/asan/user-section-3.c: New test.

Ok, with minor nit.

> +      for (end = s; *end && *end != ','; ++end);

Please put ; on the following line, properly indented, so that
it is clear the for body is empty intentionally.

        Jakub

Reply via email to