Commit 8938addc authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

Clang: Remove QTC_ASSERT

If an editor is opened, the semantic highlighter is triggered twice:

  1) From ClangEditorDocumentProcessor::onParserFinished
  2) From CppEditorDocument::applyFontSettings

Caller 1) is expected, it creates an m_unit. However, if threads are
scheduled differently, the semantic highlighter triggered from 2) will
encounter an invalid m_unit.

I'm not sure whether the call to 2) is correct at all.

Change-Id: Ia6ff2852e7d38418ebb01edc3eca3680fac1820a
Reviewed-by: default avatarMarco Bubke <>
parent 91ee695c
......@@ -333,9 +333,8 @@ QList<SourceMarker> SemanticMarker::sourceMarkersInRange(unsigned firstLine,
unsigned lastLine)
QList<SourceMarker> result;
QTC_ASSERT(m_unit, return result);
if (!m_unit->isLoaded())
if (!m_unit || !m_unit->isLoaded())
return result;
// Highlighting called asynchronously, and a few lines at the end can be deleted for this time.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment