forked from qt-creator/qt-creator
CPlusPlus: Fix crash in FindUsages
Amends 45dd074441
.
Change-Id: I6d32bfe4798eca4fa5cb7786cd72e4f9e109a1b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -148,7 +148,7 @@ void FindUsages::reportResult(unsigned tokenIndex, const QList<LookupItem> &cand
|
|||||||
Usage::Type FindUsages::getType(int line, int column, int tokenIndex)
|
Usage::Type FindUsages::getType(int line, int column, int tokenIndex)
|
||||||
{
|
{
|
||||||
const auto containsToken = [tokenIndex](const AST *ast) {
|
const auto containsToken = [tokenIndex](const AST *ast) {
|
||||||
return ast->firstToken() <= tokenIndex && ast->lastToken() > tokenIndex;
|
return ast && ast->firstToken() <= tokenIndex && ast->lastToken() > tokenIndex;
|
||||||
};
|
};
|
||||||
const auto isAssignment = [this](int token) {
|
const auto isAssignment = [this](int token) {
|
||||||
switch (tokenKind(token)) {
|
switch (tokenKind(token)) {
|
||||||
|
Reference in New Issue
Block a user