From: Nicholas Nethercote Date: Mon, 10 Aug 2009 07:50:00 +0000 (+0000) Subject: Count leak as errors. Fixes bug 152393. X-Git-Tag: svn/VALGRIND_3_5_0~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49d480e3cab35a40712dd7c9ed5def853d1b1a4a;p=thirdparty%2Fvalgrind.git Count leak as errors. Fixes bug 152393. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10767 --- diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c index 41918357cc..51ed7cf90d 100644 --- a/coregrind/m_errormgr.c +++ b/coregrind/m_errormgr.c @@ -737,11 +737,10 @@ void VG_(maybe_record_error) ( ThreadId tid, guaranteed to only happen once. This avoids all the recording and comparing stuff. But they can be suppressed; returns True if it is suppressed. Bool 'print_error' dictates whether to print the error. - Bool 'count_error' dictates whether to count the error in n_errs_found. */ Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind, Addr a, Char* s, void* extra, ExeContext* where, Bool print_error, - Bool allow_db_attach, Bool count_error ) + Bool allow_db_attach ) { Error err; Supp *su; @@ -760,8 +759,7 @@ Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind, Addr a, Char* s, su = is_suppressible_error(&err); if (NULL == su) { - if (count_error) - n_errs_found++; + n_errs_found++; if (print_error) { /* A bit of prettyprinting, to ensure there's a blank line diff --git a/include/pub_tool_errormgr.h b/include/pub_tool_errormgr.h index a473c6b641..01c073e9fc 100644 --- a/include/pub_tool_errormgr.h +++ b/include/pub_tool_errormgr.h @@ -85,7 +85,7 @@ extern void VG_(maybe_record_error) ( ThreadId tid, ErrorKind ekind, extern Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind, Addr a, Char* s, void* extra, ExeContext* where, Bool print_error, - Bool allow_GDB_attach, Bool count_error ); + Bool allow_GDB_attach ); /* Gets a non-blank, non-comment line from fd. bufpp is a pointer to a pointer to a buffer that must be allocated with VG_(malloc); nBufp is a diff --git a/memcheck/mc_errors.c b/memcheck/mc_errors.c index f646a96630..d57e819885 100644 --- a/memcheck/mc_errors.c +++ b/memcheck/mc_errors.c @@ -951,7 +951,7 @@ Bool MC_(record_leak_error) ( ThreadId tid, UInt n_this_record, return VG_(unique_error) ( tid, Err_Leak, /*Addr*/0, /*s*/NULL, &extra, lr->key.allocated_at, print_record, - /*allow_GDB_attach*/False, /*count_error*/False ); + /*allow_GDB_attach*/False ); } void MC_(record_user_error) ( ThreadId tid, Addr a, diff --git a/memcheck/tests/error_counts.stdout.exp b/memcheck/tests/error_counts.stdout.exp index 66c8a64926..9ad46a128c 100644 --- a/memcheck/tests/error_counts.stdout.exp +++ b/memcheck/tests/error_counts.stdout.exp @@ -12,4 +12,4 @@ dubious: 88 bytes in 1 blocks reachable: 99 bytes in 1 blocks suppressed: 0 bytes in 0 blocks -errors: 1 +errors: 10