forked from qt-creator/qt-creator
Clang: Fix/silence some coverty issues
clangcompletionassistprocessor.cpp: 136 CID 1475671: Possible Control flow issues (DEADCODE) Execution cannot reach the expression "codeCompletion.completionKind != ClangBackEnd::CodeCompletion::SlotCompletionKind" inside this statement: "if (slotCompletion && codeC...". clangbackendcommunicator.cpp: 272 CID 1475649: Null pointer dereferences (NULL_RETURNS) Dereferencing a pointer that might be null "document" when calling "contents". (The dereference happens because this is a virtual function call.) clangutils.cpp: 335 CID 1475678: Error handling issues (CHECKED_RETURN) Calling "open" without checking return value (as is done elsewhere 144 out of 158 times). codecompletionsextractor.cpp: 48 CID 1475676: Uninitialized members (UNINIT_CTOR) Non-static class member field "currentCxCodeCompleteResult.CompletionString" is not initialized in this constructor nor in any functions that it calls. Change-Id: I4c8767ee6e824ba1c42d2f8914ad66dc95ac6717 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -261,14 +261,14 @@ void BackendCommunicator::unsavedFilesUpdatedForUiHeaders()
|
||||
void BackendCommunicator::documentsChangedFromCppEditorDocument(const QString &filePath)
|
||||
{
|
||||
const CppTools::CppEditorDocumentHandle *document = ClangCodeModel::Utils::cppDocument(filePath);
|
||||
|
||||
QTC_ASSERT(document, return);
|
||||
documentsChanged(filePath, document->contents(), document->revision());
|
||||
}
|
||||
|
||||
void BackendCommunicator::unsavedFielsUpdatedFromCppEditorDocument(const QString &filePath)
|
||||
{
|
||||
const CppTools::CppEditorDocumentHandle *document = ClangCodeModel::Utils::cppDocument(filePath);
|
||||
|
||||
QTC_ASSERT(document, return);
|
||||
unsavedFilesUpdated(filePath, document->contents(), document->revision());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user