Home | History | Annotate | Download | only in tests
      1 
      2 #include <stdlib.h>
      3 
      4 int* mk_dangle(void)
      5 {
      6    int* x = malloc(400);
      7    free(x);
      8 
      9    return x;
     10 }
     11 
     12 int main(void)
     13 {
     14    int  y;
     15    int* x = mk_dangle();
     16 
     17    y = x[5];
     18    y = x[-1];
     19 
     20    return 0;
     21 }
     22