From: Julian Seward Date: Fri, 14 Aug 2015 09:02:46 +0000 (+0000) Subject: Bug 348345 - Assertion fails for negative lineno X-Git-Tag: svn/VALGRIND_3_11_0~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c3ef7eb807d54283863f6e37470ece7839e8c71;p=thirdparty%2Fvalgrind.git Bug 348345 - Assertion fails for negative lineno (in ML_(addLineInfo)) Patch from Jim Garrison (jim@garrison.cc) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15544 --- diff --git a/coregrind/m_debuginfo/storage.c b/coregrind/m_debuginfo/storage.c index 75dec20831..3884d5292f 100644 --- a/coregrind/m_debuginfo/storage.c +++ b/coregrind/m_debuginfo/storage.c @@ -537,7 +537,18 @@ void ML_(addLineInfo) ( struct _DebugInfo* di, return; } - vg_assert(lineno >= 0); + if (lineno < 0) { + static Bool complained = False; + if (!complained) { + complained = True; + VG_(message)(Vg_UserMsg, + "warning: ignoring line info entry with " + "negative line number (%d)\n", lineno); + VG_(message)(Vg_UserMsg, + "(Nb: this message is only shown once)\n"); + } + return; + } if (lineno > MAX_LINENO) { static Bool complained = False; if (!complained) {