From 0ced16d17a2eaa1b6aaf4c25a1e1f28f01aa395d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 21 Apr 2014 08:01:01 +0200 Subject: [PATCH] CheckExceptionSafety: Fixed crash when a function is missing function scope --- lib/checkexceptionsafety.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/checkexceptionsafety.cpp b/lib/checkexceptionsafety.cpp index abe0c60d3..f793891de 100644 --- a/lib/checkexceptionsafety.cpp +++ b/lib/checkexceptionsafety.cpp @@ -184,6 +184,9 @@ static const Token * functionThrowsRecursive(const Function * function, std::set if (recursive.find(function) != recursive.end()) return nullptr; + if (!function->functionScope) + return nullptr; + for (const Token *tok = function->functionScope->classStart->next(); tok != function->functionScope->classEnd; tok = tok->next()) { if (tok->str() == "try") {