forked from qt-creator/qt-creator
CppEditor: Fix access to dangling pointer
Found by coverity. Change-Id: I4b73af9b22b80953b4ba6c1004884862c9bdd3b8 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -1983,7 +1983,7 @@ LookupResult lookUpDefinition(const CppQuickFixInterface &interface, const NameA
|
||||
|
||||
// Find the enclosing scope
|
||||
int line, column;
|
||||
const Document::Ptr &doc = interface.semanticInfo().doc;
|
||||
const Document::Ptr doc = interface.semanticInfo().doc;
|
||||
doc->translationUnit()->getTokenStartPosition(nameAst->firstToken(), &line, &column);
|
||||
Scope *scope = doc->scopeAt(line, column);
|
||||
if (!scope)
|
||||
|
||||
Reference in New Issue
Block a user