]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge r9285 (match-overrun fixes) from the DARWIN branch.
authorNicholas Nethercote <njn@valgrind.org>
Thu, 26 Feb 2009 22:38:42 +0000 (22:38 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Thu, 26 Feb 2009 22:38:42 +0000 (22:38 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9286

memcheck/tests/match-overrun.c
memcheck/tests/match-overrun.stderr.exp
memcheck/tests/match-overrun.supp
memcheck/tests/match-overrun.vgtest

index 4c618fb794e0a69a290e49c26bbf2ae42b63dd3e..b859ab3a353aaec9f8b70255af4108ecffebdb98 100644 (file)
@@ -1,9 +1,12 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "memcheck/memcheck.h"
 
 static int a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(void)
 {
-  return *(int *)0;
+  int x;
+  VALGRIND_MAKE_MEM_NOACCESS(&x, sizeof(x));
+  return *(int *)&x;
 }
 
 int main(int argc, char **argv)
index 4ff0e7c7879ff4f8f0728434c2a8def49e759bd2..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,16 +0,0 @@
-
-
-Process terminating with default action of signal 11 (SIGSEGV)
- Access not within mapped region at address 0x........
-   at 0x........: a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 (match-overrun.c:6)
-   by 0x........: main (match-overrun.c:11)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
- The main thread stack size used in this run was ....
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis,  rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
index e69ec8a5abdd2ac6cd921a50e7a8392a69159a4a..2f5893c20be3b5ee38756df297591a69d839cc88 100644 (file)
@@ -2,4 +2,5 @@
    test
    Memcheck:Addr4
    fun:a123456789*
+   fun:main
 }
index 85ca9739736efb0af5c486a81a60fca77443e1dc..d189ed2dabd79da3341cc0f55ac751c3d63500a0 100644 (file)
@@ -1,3 +1,3 @@
 prog: match-overrun
-vgopts: --suppressions=match-overrun.supp
+vgopts: -q --suppressions=match-overrun.supp
 stderr_filter: filter_allocs