This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
This patch imports the initial state of asan as it was in the Google branch.
It provides basic infrastructure for asan to instrument memory accesses on the heap, at -O3. Note that it supports neither stack nor global variable protection.
#include <stdlib.h> #include <stdio.h>
int main() { int *i; i = malloc(10*sizeof(*i)); free(i); /* <<< Free memory. */ i[10] = 5; /* <<< out of boundary even if not freed. */ printf("%d\n", i[11]); /* <<< out of boundary even if not freed. */ return 0; }
#include <stdlib.h> #include <stdio.h> int main() { int *i; i = malloc(10*sizeof(*i)); free(i); /* <<< Free memory. */ i[10] = 5; /* <<< out of boundary even if not freed. */ printf("%d\n", i[11]); /* <<< out of boundary even if not freed. */ return 0; }
Attachment:
hjf.c.156t.asan0
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |