Merge pull request #2720 from pfultz2/crash-type-scope

Fix crash when typeScope is missing
This commit is contained in:
Daniel Marjamäki 2020-07-23 09:31:59 +02:00 committed by GitHub
commit f4a6f8ad07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1331,6 +1331,8 @@ static const Variable* getArgumentVar(const Token* tok, int argnr)
if (!type) if (!type)
return nullptr; return nullptr;
const Scope* typeScope = type->classScope; const Scope* typeScope = type->classScope;
if (!typeScope)
return nullptr;
const int argCount = numberOfArguments(tok); const int argCount = numberOfArguments(tok);
for (const Function &function : typeScope->functionList) { for (const Function &function : typeScope->functionList) {
if (function.isConstructor()) if (function.isConstructor())