CheckExceptionSafety: Fixed crash when a function is missing function scope
This commit is contained in:
parent
6ff5de2118
commit
0ced16d17a
|
@ -184,6 +184,9 @@ static const Token * functionThrowsRecursive(const Function * function, std::set
|
||||||
if (recursive.find(function) != recursive.end())
|
if (recursive.find(function) != recursive.end())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
if (!function->functionScope)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
for (const Token *tok = function->functionScope->classStart->next();
|
for (const Token *tok = function->functionScope->classStart->next();
|
||||||
tok != function->functionScope->classEnd; tok = tok->next()) {
|
tok != function->functionScope->classEnd; tok = tok->next()) {
|
||||||
if (tok->str() == "try") {
|
if (tok->str() == "try") {
|
||||||
|
|
Loading…
Reference in New Issue