On Thu, Sep 27, 2018 at 10:55:10AM +0200, Martin Liška wrote:
> @@ -1281,15 +1284,30 @@ asan_emit_stack_protection (rtx base, rtx pbase,
> unsigned int alignb,
> pp_space (&asan_pp);
> pp_wide_integer (&asan_pp, offsets[l - 1] - offsets[l]);
> pp_space (&asan_pp);
> +
> + expanded_location xloc
> + = expand_location (DECL_SOURCE_LOCATION (decl));
> + char location[32];
> +
> + if (xloc.file == cfun_xloc.file)
> + sprintf (location, ":%d", xloc.line);
> + else
> + location[0] = '\0';
> +
> if (DECL_P (decl) && DECL_NAME (decl))
> {
> - pp_decimal_int (&asan_pp, IDENTIFIER_LENGTH (DECL_NAME (decl)));
> + unsigned l
Shadowing a variable is not a good idea. Can you use say idlen
or something similar (we have l and length taken already)?
> + = IDENTIFIER_LENGTH (DECL_NAME (decl)) + strlen (location);
> + pp_decimal_int (&asan_pp, l);
> pp_space (&asan_pp);
> pp_tree_identifier (&asan_pp, DECL_NAME (decl));
> + pp_string (&asan_pp, location);
> }
> else
> pp_string (&asan_pp, "9 <unknown>");
> - pp_space (&asan_pp);
> +
> + if (l > 2)
> + pp_space (&asan_pp);
Otherwise LGTM.
Jakub