diff options
author | Patrik Nyblom <[email protected]> | 2011-02-28 11:57:02 +0100 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2011-02-28 11:57:02 +0100 |
commit | 5dd7bdee141803099b5a9b4eba18c6f04048ba40 (patch) | |
tree | 5b32545be6af648de3deda4c562d827e4bff452c | |
parent | 1b161433719e79d812b61672f1a864886a5aa8d3 (diff) | |
download | otp-5dd7bdee141803099b5a9b4eba18c6f04048ba40.tar.gz otp-5dd7bdee141803099b5a9b4eba18c6f04048ba40.tar.bz2 otp-5dd7bdee141803099b5a9b4eba18c6f04048ba40.zip |
Make crypto.c work with valgrind 3.6 and correct cerl.src
-rw-r--r-- | erts/etc/unix/cerl.src | 6 | ||||
-rw-r--r-- | lib/crypto/c_src/crypto.c | 14 |
2 files changed, 15 insertions, 5 deletions
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src index b873f04dd3..69840daf69 100644 --- a/erts/etc/unix/cerl.src +++ b/erts/etc/unix/cerl.src @@ -238,7 +238,11 @@ if [ "x$GDB" = "x" ]; then else export VALGRIND_LOG_XML valgrind_xml="--xml=yes" - log_file_prefix="--xml-file=" + if [ $valmajor -gt 2 -a $valminor -gt 4 ]; then + log_file_prefix="--xml-file=" + else + log_file_prefix="--log-file=" + fi fi if [ "x$VALGRIND_LOG_DIR" = "x" ]; then valgrind_log= diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 92cc2b4dd9..0e7e63eb73 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -62,10 +62,16 @@ # define ERL_VALGRIND_MAKE_MEM_DEFINED(ptr,size) \ VALGRIND_MAKE_MEM_DEFINED(ptr,size) - # define ERL_VALGRIND_ASSERT_MEM_DEFINED(ptr,size) \ - ((void) ((VALGRIND_CHECK_MEM_IS_DEFINED(ptr,size) == 0) ? 1 : \ - (fprintf(stderr,"\r\n####### VALGRIND_ASSSERT(%p,%ld) failed at %s:%d\r\n",\ - (ptr),(long)(size), __FILE__, __LINE__), abort(), 0))) + # define ERL_VALGRIND_ASSERT_MEM_DEFINED(Ptr,Size) \ + do { \ + int __erl_valgrind_mem_defined = VALGRIND_CHECK_MEM_IS_DEFINED((Ptr),(Size)); \ + if (__erl_valgrind_mem_defined != 0) { \ + fprintf(stderr,"\r\n####### VALGRIND_ASSSERT(%p,%ld) failed at %s:%d\r\n", \ + (Ptr),(long)(Size), __FILE__, __LINE__); \ + abort(); \ + } \ + } while (0) + #else # define ERL_VALGRIND_MAKE_MEM_DEFINED(ptr,size) # define ERL_VALGRIND_ASSERT_MEM_DEFINED(ptr,size) |