Julian Seward 31b741dc9b Merge the Ptrcheck tool from branches/PTRCHECK r8619.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8620
2008-09-18 14:43:05 +00:00

20 lines
451 B
C

#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/time.h>
int main(void)
{
int i = 11;
char* buf = malloc(sizeof(char) * 6);
char c = buf[-1]; // LoadStoreErr
char* x = buf + (long)buf; // ArithErr
char* y = (char*)((long)buf * i); // AsmErr
write(-1, buf+3, 5); // SysParamErr
return x-y+c;
}