Files
ftmemsim-valgrind/exp-ptrcheck/tests/hp_bounds.c
2011-04-03 17:42:19 +00:00

14 lines
206 B
C

#include <stdlib.h>
int main(void)
{
int y __attribute__((unused));
int* x = malloc(sizeof(int) * 100);
y = x[95]; // ok
y = x[100]; // overrun
y = x[-1]; // underrun
return 0;
}