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 <hjk@theqtcompany.com>
This commit is contained in:
Christian Stenger
2016-04-14 15:39:56 +02:00
parent 3310fbc8f2
commit 0a9e40dc9d

View File

@@ -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