forked from qt-creator/qt-creator
ClangD: Fix possible access violation
Change-Id: I6b54dcdb42f9f9e2c3a9fd686146d253dcdfa40c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -2246,7 +2246,7 @@ static void cleanupDisabledCode(TextEditor::HighlightingResults &results, QTextD
|
||||
continue;
|
||||
}
|
||||
|
||||
if (wasInDisabled && (it == results.end()
|
||||
if (wasInDisabled && (it + 1 == results.end()
|
||||
|| (it + 1)->textStyles.mainStyle != TextEditor::C_DISABLED_CODE)) {
|
||||
// The #else or #endif that ends disabled code should not be disabled.
|
||||
it = results.erase(it);
|
||||
|
||||
Reference in New Issue
Block a user