From: Julian Seward Date: Tue, 7 May 2002 23:45:03 +0000 (+0000) Subject: Actually call VG_(first_and_last_secondaries_look_plausible) and make X-Git-Tag: svn/VALGRIND_1_0_3~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9c76f10809db735aea739c438e89d7436b3a631;p=thirdparty%2Fvalgrind.git Actually call VG_(first_and_last_secondaries_look_plausible) and make assertions about the return value, rather than asserting the non-NULL-ness of the function's address :) Classic beginner's mistake, compounded by C's crappy (non-existent) type system, which allows me to silently confuse Bool with Pointer-to-Function. What a great programming language. Come back Haskell, all is forgiven. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@228 --- diff --git a/coregrind/vg_memory.c b/coregrind/vg_memory.c index a6a2c5d929..f39592a16e 100644 --- a/coregrind/vg_memory.c +++ b/coregrind/vg_memory.c @@ -539,7 +539,7 @@ static void set_address_range_perms ( Addr a, UInt len, -- this could happen with buggy syscall wrappers. Today (2001-04-26) had precisely such a problem with __NR_setitimer. */ - vg_assert(VG_(first_and_last_secondaries_look_plausible)); + vg_assert(VG_(first_and_last_secondaries_look_plausible)()); VGP_POPCC; } @@ -2219,7 +2219,7 @@ void VG_(do_sanity_checks) ( Bool force_expensive ) /* Check that nobody has spuriously claimed that the first or last 16 pages of memory have become accessible [...] */ - vg_assert(VG_(first_and_last_secondaries_look_plausible)); + vg_assert(VG_(first_and_last_secondaries_look_plausible)()); } /* --- Now some more expensive checks. ---*/ diff --git a/vg_memory.c b/vg_memory.c index a6a2c5d929..f39592a16e 100644 --- a/vg_memory.c +++ b/vg_memory.c @@ -539,7 +539,7 @@ static void set_address_range_perms ( Addr a, UInt len, -- this could happen with buggy syscall wrappers. Today (2001-04-26) had precisely such a problem with __NR_setitimer. */ - vg_assert(VG_(first_and_last_secondaries_look_plausible)); + vg_assert(VG_(first_and_last_secondaries_look_plausible)()); VGP_POPCC; } @@ -2219,7 +2219,7 @@ void VG_(do_sanity_checks) ( Bool force_expensive ) /* Check that nobody has spuriously claimed that the first or last 16 pages of memory have become accessible [...] */ - vg_assert(VG_(first_and_last_secondaries_look_plausible)); + vg_assert(VG_(first_and_last_secondaries_look_plausible)()); } /* --- Now some more expensive checks. ---*/ diff --git a/vg_syscall_mem.c b/vg_syscall_mem.c index 3ef4904c55..6a98267188 100644 --- a/vg_syscall_mem.c +++ b/vg_syscall_mem.c @@ -365,7 +365,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) /* Since buggy syscall wrappers sometimes break this, we may as well check ourselves. */ - if (! VG_(first_and_last_secondaries_look_plausible)) + if (! VG_(first_and_last_secondaries_look_plausible)()) sane_before_call = False; /* the syscall no is in %eax. For syscalls with <= 5 args, @@ -2861,7 +2861,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) /* { void zzzmemscan(void); zzzmemscan(); } */ - if (! VG_(first_and_last_secondaries_look_plausible)) + if (! VG_(first_and_last_secondaries_look_plausible)()) sane_before_call = False; if (sane_before_call && (!sane_after_call)) { @@ -2908,7 +2908,7 @@ void VG_(check_known_blocking_syscall) ( ThreadId tid, VGP_PUSHCC(VgpSyscall); if (res != NULL - && ! VG_(first_and_last_secondaries_look_plausible)) + && ! VG_(first_and_last_secondaries_look_plausible)()) sane_before_post = False; switch (syscallno) { @@ -2965,7 +2965,7 @@ void VG_(check_known_blocking_syscall) ( ThreadId tid, } if (res != NULL) { /* only check after syscall */ - if (! VG_(first_and_last_secondaries_look_plausible)) + if (! VG_(first_and_last_secondaries_look_plausible)()) sane_after_post = False; if (sane_before_post && (!sane_after_post)) {