https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501

            Bug ID: 82501
           Summary: AddressSanitizer does not handle negative offset for
                    first global variable
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

$ cat main.c
int g = 0;
int main(int argc, char **argv)
{
  int *ptr = &g;
  *(ptr - 1) = 'c'; // should BOOM here
}

$ gcc main.c -fsanitize=address && ./a.out

Reply via email to