[PATCHv3][Kasan][PING^3] Allow to override Asan shadow offset from command line

Jakub Jelinek jakub@redhat.com
Wed Oct 15 16:54:00 GMT 2014


On Wed, Oct 15, 2014 at 08:17:39PM +0400, Yury Gribov wrote:
> +static unsigned HOST_WIDE_INT asan_shadow_offset_value;
> +static bool asan_shadow_offset_computed;
> +
> +/* Sets shadow offset to value in string VAL.  */
> +
> +bool
> +set_asan_shadow_offset (const char *val)
> +{
> +  char *endp;
> +  
> +  errno = 0;
> +  asan_shadow_offset_value = strtoul (val, &endp, 0);

This will not really work well e.g. for 32-bit cross-compilers
to 64-bit.
I'm afraid you need to use strtoull here, libiberty has strtoul.c
already, perhaps just copying that to strtoull.c and adjusting types
etc. (and guarding it whole with HAVE_LONG_LONG)?
Then just use strtoull here if either HAVE_LONG_LONG instead
of strtoul.

	Jakub



More information about the Gcc-patches mailing list