diff options
author | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2011-04-11 16:17:51 +0000 |
---|---|---|
committer | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2011-04-11 16:17:51 +0000 |
commit | 6c591e15c1d6402a2a755310f005f795b68e7e38 (patch) | |
tree | 482318c3fe643680a251dbb1954ff985ddda2c2c /memcheck | |
parent | 08f5a27676dedc7197a8b81f80ebc83d1e311af9 (diff) |
Create new module m_libcsetjmp, which wraps up uses of
__builtin_setjmp and __builtin_longjmp so that they can be selectively
replaced, on a platform by platform basis. Does not change any
functionality. Related to #259977.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11687 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'memcheck')
-rw-r--r-- | memcheck/mc_leakcheck.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c index 13b8de39..bdf0fc66 100644 --- a/memcheck/mc_leakcheck.c +++ b/memcheck/mc_leakcheck.c @@ -43,12 +43,11 @@ #include "pub_tool_options.h" #include "pub_tool_oset.h" #include "pub_tool_signals.h" +#include "pub_tool_libcsetjmp.h" // setjmp facilities #include "pub_tool_tooliface.h" // Needed for mc_include.h #include "mc_include.h" -#include <setjmp.h> // For jmp_buf - /*------------------------------------------------------------*/ /*--- An overview of leak checking. ---*/ /*------------------------------------------------------------*/ @@ -636,7 +635,7 @@ lc_push_if_a_chunk_ptr(Addr ptr, Int clique, Bool is_prior_definite) } -static jmp_buf memscan_jmpbuf; +static VG_MINIMAL_JMP_BUF memscan_jmpbuf; static void scan_all_valid_memory_catcher ( Int sigNo, Addr addr ) @@ -644,7 +643,7 @@ void scan_all_valid_memory_catcher ( Int sigNo, Addr addr ) if (0) VG_(printf)("OUCH! sig=%d addr=%#lx\n", sigNo, addr); if (sigNo == VKI_SIGSEGV || sigNo == VKI_SIGBUS) - __builtin_longjmp(memscan_jmpbuf, 1); + VG_MINIMAL_LONGJMP(memscan_jmpbuf); } // Scan a block of memory between [start, start+len). This range may @@ -686,7 +685,7 @@ lc_scan_memory(Addr start, SizeT len, Bool is_prior_definite, Int clique) } } - if (__builtin_setjmp(memscan_jmpbuf) == 0) { + if (VG_MINIMAL_SETJMP(memscan_jmpbuf) == 0) { if ( MC_(is_valid_aligned_word)(ptr) ) { lc_scanned_szB += sizeof(Addr); addr = *(Addr *)ptr; |