[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 4 08:08:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Small note: on powerpc sanitization does not work for last global variable:
volatile int v;
__attribute__((noipa)) void
foo (char *p, char *q)
{
*p = 123;
// v = p > q;
}
char __attribute__((used)) largest_global2[1] = {};
char small_global[1] = {};
//char __attribute__((used)) largest_global[1] = {};
int
main ()
{
/* Global variables. */
char *p = &small_global[0];
__asm ("" : "+g" (p));
/* { dg-output "ERROR: AddressSanitizer: invalid-pointer-pair.*" } */
foo (p - 1, p);
return 0;
}
More information about the Gcc-bugs
mailing list