From 0a9e40dc9dd918035bb7d5704b884f14b7343439 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 14 Apr 2016 15:39:56 +0200 Subject: [PATCH] Valgrind: Avoid soft assert on missing line numbers If callgrind does not find a valid line number information trying to paint the respective text mark runs into a soft assert. Avoid this by not creating a text mark for such results. Change-Id: Ib1c49db82fd4d46bf84ecdc398b88fb0ca09707d Reviewed-by: hjk --- src/plugins/valgrind/callgrindtool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 182106f7e38..94351cb8532 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -937,6 +937,9 @@ void CallgrindTool::createTextMarks() bool ok = false; const int lineNumber = index.data(DataModel::LineNumberRole).toInt(&ok); QTC_ASSERT(ok, continue); + // avoid creating invalid text marks + if (lineNumber <= 0) + continue; // sanitize filename, text marks need a canonical (i.e. no ".."s) path // BaseTextMark::editorOpened(Core::IEditor *editor) compares file names on string basis