Fixed #7866 (Crash while scanning QML files)

This commit is contained in:
Sam Truscott 2017-05-28 16:39:18 +02:00 committed by Daniel Marjamäki
parent 25e50e2a98
commit 956b5812e7
1 changed files with 4 additions and 1 deletions

View File

@ -95,10 +95,13 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer, const char Fi
// parsing of library code to find called functions
if (settings->library.isexecutableblock(FileName, tok->str())) {
const Token * markupVarToken = tok->tokAt(settings->library.blockstartoffset(FileName));
// not found
if (!markupVarToken)
continue;
int scope = 0;
bool start = true;
// find all function calls in library code (starts with '(', not if or while etc)
while (scope || start) {
while ((scope || start) && markupVarToken) {
if (markupVarToken->str() == settings->library.blockstart(FileName)) {
scope++;
if (start) {