From 8c3ef7eb807d54283863f6e37470ece7839e8c71 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Fri, 14 Aug 2015 09:02:46 +0000 Subject: [PATCH] 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 --- coregrind/m_debuginfo/storage.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) { -- 2.47.2