|
From: <sv...@va...> - 2014-10-06 21:53:11
|
Author: florian
Date: Mon Oct 6 22:53:04 2014
New Revision: 14604
Log:
Add a few asserts.
Modified:
branches/BUF_REMOVAL/drd/drd_error.c
branches/BUF_REMOVAL/exp-sgcheck/pc_common.c
branches/BUF_REMOVAL/helgrind/hg_errors.c
branches/BUF_REMOVAL/memcheck/mc_errors.c
Modified: branches/BUF_REMOVAL/drd/drd_error.c
==============================================================================
--- branches/BUF_REMOVAL/drd/drd_error.c (original)
+++ branches/BUF_REMOVAL/drd/drd_error.c Mon Oct 6 22:53:04 2014
@@ -602,6 +602,7 @@
SizeT drd_get_extra_suppression_info(Error* e,
/*OUT*/HChar* buf, Int nBuf)
{
+ tl_assert(nBuf >= 1);
buf[0] = '\0';
return 0;
}
@@ -610,6 +611,7 @@
SizeT drd_print_extra_suppression_use(Supp* su,
/*OUT*/HChar* buf, Int nBuf)
{
+ tl_assert(nBuf >= 1);
buf[0] = '\0';
return 0;
}
Modified: branches/BUF_REMOVAL/exp-sgcheck/pc_common.c
==============================================================================
--- branches/BUF_REMOVAL/exp-sgcheck/pc_common.c (original)
+++ branches/BUF_REMOVAL/exp-sgcheck/pc_common.c Mon Oct 6 22:53:04 2014
@@ -780,6 +780,7 @@
{
ErrorKind ekind = VG_(get_error_kind )(err);
tl_assert(buf);
+ tl_assert(nBuf >= 1);
if (XE_SysParam == ekind) {
const HChar* errstr = VG_(get_error_string)(err);
@@ -794,6 +795,7 @@
SizeT pc_print_extra_suppression_use ( Supp* su,
/*OUT*/HChar* buf, Int nBuf )
{
+ tl_assert(nBuf >= 1);
buf[0] = '\0';
return 0;
}
Modified: branches/BUF_REMOVAL/helgrind/hg_errors.c
==============================================================================
--- branches/BUF_REMOVAL/helgrind/hg_errors.c (original)
+++ branches/BUF_REMOVAL/helgrind/hg_errors.c Mon Oct 6 22:53:04 2014
@@ -1311,6 +1311,7 @@
SizeT HG_(get_extra_suppression_info) ( Error* err,
/*OUT*/HChar* buf, Int nBuf )
{
+ tl_assert(nBuf >= 1);
/* Do nothing */
buf[0] = '\0';
return 0;
@@ -1319,6 +1320,7 @@
SizeT HG_(print_extra_suppression_use) ( Supp* su,
/*OUT*/HChar* buf, Int nBuf )
{
+ tl_assert(nBuf >= 1);
/* Do nothing */
buf[0] = '\0';
return 0;
Modified: branches/BUF_REMOVAL/memcheck/mc_errors.c
==============================================================================
--- branches/BUF_REMOVAL/memcheck/mc_errors.c (original)
+++ branches/BUF_REMOVAL/memcheck/mc_errors.c Mon Oct 6 22:53:04 2014
@@ -1516,6 +1516,7 @@
{
ErrorKind ekind = VG_(get_error_kind )(err);
tl_assert(buf);
+ tl_assert(nBuf >= 1);
if (Err_RegParam == ekind || Err_MemParam == ekind) {
const HChar* errstr = VG_(get_error_string)(err);
@@ -1539,6 +1540,8 @@
SizeT MC_(print_extra_suppression_use) ( Supp *su,
/*OUT*/HChar *buf, Int nBuf )
{
+ tl_assert(nBuf >= 1);
+
if (VG_(get_supp_kind)(su) == LeakSupp) {
MC_LeakSuppExtra *lse = (MC_LeakSuppExtra*) VG_(get_supp_extra) (su);
|