]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 348345 - Assertion fails for negative lineno
authorJulian Seward <jseward@acm.org>
Fri, 14 Aug 2015 09:02:46 +0000 (09:02 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 14 Aug 2015 09:02:46 +0000 (09:02 +0000)
(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

index 75dec208313c509bb62571e92f93b11755fea641..3884d5292fbf3dcb05ca869f1cba14c06edb14c5 100644 (file)
@@ -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) {