From: Julian Seward Date: Wed, 4 May 2011 09:06:17 +0000 (+0000) Subject: calling format_message: when passing frameNo == -1, also pass X-Git-Tag: svn/VALGRIND_3_7_0~514 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ccdd881a633aa3f27b08b7a32fe5c9d3db9b516;p=thirdparty%2Fvalgrind.git calling format_message: when passing frameNo == -1, also pass tid == VG_INVALID_THREADID rather than an uninitialised ThreadId. Also in format_message, improve precondition assertions for frameNo and tid. There's no error in the current code since if frameNo == -1 then tid is unused, but it caused IBM's BEAM checker to complain. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11723 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 8e431ade61..52d3c66044 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -2665,7 +2665,16 @@ static void format_message ( /*MOD*/XArray* /* of HChar */ dn1, UChar* basetag = "auxwhat"; /* a constant */ UChar tagL[32], tagR[32], xagL[32], xagR[32]; - vg_assert(frameNo >= -1); + if (frameNo < -1) { + vg_assert(0); /* Not allowed */ + } + else if (frameNo == -1) { + vg_assert(tid == VG_INVALID_THREADID); + } + else /* (frameNo >= 0) */ { + vg_assert(tid != VG_INVALID_THREADID); + } + vg_assert(dn1 && dn2); vg_assert(described); vg_assert(var && var->name); @@ -3152,7 +3161,8 @@ Bool VG_(get_data_description)( var->typeR, offset ); format_message( dname1, dname2, data_addr, var, offset, residual_offset, - described, -1/*frameNo*/, tid ); + described, -1/*frameNo*/, + VG_INVALID_THREADID ); VG_(deleteXA)( described ); zterm_XA( dname1 ); zterm_XA( dname2 );