]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Tweak manuel2 so that the Memcheck-detected error is more reliable, and that
authorNicholas Nethercote <njn@valgrind.org>
Wed, 16 Mar 2005 03:07:33 +0000 (03:07 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 16 Mar 2005 03:07:33 +0000 (03:07 +0000)
we never accidentally also get an undefined-condition-error.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3371

memcheck/tests/manuel2.c
memcheck/tests/manuel2.stderr.exp

index 8c6f85b713f82b57b52391631be438ab4cda515e..1fc1269e1771fef82d362c81afe41faeefbdf75e 100644 (file)
@@ -3,7 +3,9 @@
 
 int main ()
 {
-  int *x;
+  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);
 
index 2d66c1dc77b9b88c9e227a3e1591d8dad9a1afed..daad6c6b6fdd4b2aa8d39aefba92c21471690641 100644 (file)
@@ -1,2 +1,2 @@
 Use of uninitialised value of size 4
-   at 0x........: main (manuel2.c:8)
+   at 0x........: main (manuel2.c:10)