Commit 01bb7443 authored by Christian Kamm's avatar Christian Kamm

C++: Fix off-by-one in scopeAt.

The only Scope that set the end offset to *before* the last token
was ObjCClassDeclaration.

Change-Id: Icbdb5bcdd72d96087ac586ad51510fed74a633eb
Reviewed-on: http://codereview.qt.nokia.com/2820Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
parent 476338a6
......@@ -2296,7 +2296,7 @@ bool Bind::visit(ObjCClassDeclarationAST *ast)
_scope->addMember(klass);
klass->setStartOffset(calculateScopeStart(ast));
klass->setEndOffset(tokenAt(ast->lastToken() - 1).begin());
klass->setEndOffset(tokenAt(ast->lastToken() - 1).end());
if (ast->interface_token)
klass->setInterface(true);
......
......@@ -142,7 +142,7 @@ protected:
unsigned endLine, endColumn;
_unit->getPosition(scope->endOffset(), &endLine, &endColumn);
if (_line < endLine || (_line == endLine && _column <= endColumn))
if (_line < endLine || (_line == endLine && _column < endColumn))
_scope = scope;
}
}
......
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