From 76e93ca812f20aeeb04e21fbd34ff0c8c5ab9757 Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Mon, 24 Sep 2012 21:37:02 +0000 Subject: [PATCH] Unbreak build on Mac_OS where __NR_mprotect is not defined. The test is not executed on Darwin but should compile. (based on fix suggestion by Rich Coe) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13014 --- memcheck/tests/leak-segv-jmp.c | 4 ++++ memcheck/tests/leak-segv-jmp.stderr.exp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/memcheck/tests/leak-segv-jmp.c b/memcheck/tests/leak-segv-jmp.c index d2267c31b..885641942 100644 --- a/memcheck/tests/leak-segv-jmp.c +++ b/memcheck/tests/leak-segv-jmp.c @@ -136,6 +136,10 @@ UWord do_syscall_WRK ( } #else +// Ensure the file compiles even if the syscall nr is not defined. +#ifndef __NR_mprotect +#define __NR_mprotect 0 +#endif UWord do_syscall_WRK (UWord syscall_no, UWord a1, UWord a2, UWord a3, UWord a4, UWord a5, UWord a6 diff --git a/memcheck/tests/leak-segv-jmp.stderr.exp b/memcheck/tests/leak-segv-jmp.stderr.exp index be567da0f..ae4b7862a 100644 --- a/memcheck/tests/leak-segv-jmp.stderr.exp +++ b/memcheck/tests/leak-segv-jmp.stderr.exp @@ -14,8 +14,8 @@ To see them, rerun with: --leak-check=full --show-reachable=yes expecting a leak 1,000 bytes in 1 blocks are definitely lost in loss record ... of ... at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: f (leak-segv-jmp.c:167) - by 0x........: main (leak-segv-jmp.c:214) + by 0x........: f (leak-segv-jmp.c:171) + by 0x........: main (leak-segv-jmp.c:218) LEAK SUMMARY: definitely lost: 1,000 bytes in 1 blocks @@ -30,8 +30,8 @@ mprotect result 0 expecting a leak again 1,000 bytes in 1 blocks are definitely lost in loss record ... of ... at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: f (leak-segv-jmp.c:167) - by 0x........: main (leak-segv-jmp.c:214) + by 0x........: f (leak-segv-jmp.c:171) + by 0x........: main (leak-segv-jmp.c:218) LEAK SUMMARY: definitely lost: 1,000 bytes in 1 blocks