Nicholas Nethercote 05cbc6b2e1 Tweak manuel2 so that the Memcheck-detected error is more reliable, and that
we never accidentally also get an undefined-condition-error.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3371
2005-03-16 03:07:33 +00:00

14 lines
220 B
C

#include <stdio.h>
#include <stdlib.h>
int main ()
{
int y = 0;
int *m = malloc(sizeof(int));
int *x = m[0] + &y; // we know m[0] will be zero
printf ("x = %d\n", *x==0xDEADBEEF ? 99 : 88);
return 0;
}