forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user