diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index d2fa6ee3082..2bef0d39671 100755 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -3134,6 +3134,21 @@ static std::string openHeader(std::ifstream &f, const simplecpp::DUI &dui, const return openHeaderIncludePath(f, dui, header); return ret; } +static bool IsFileExists(const std::string& simplePath) +{ + if (simplePath.empty()) + { + return false; + } + + std::ifstream ifs(simplePath); + if (ifs.good()) + { + return true; + } + + return false; +} static std::string getFileName(const std::map &filedata, const std::string &sourcefile, const std::string &header, const simplecpp::DUI &dui, bool systemheader) { @@ -3144,11 +3159,18 @@ static std::string getFileName(const std::map::const_iterator it = dui.includePaths.begin(); it != dui.includePaths.end(); ++it) { std::string s = simplecpp::simplifyPath(getIncludePathFileName(*it, header)); diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 36a6b00c34f..12e5590147f 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -6158,7 +6158,7 @@ void Tokenizer::dump(std::ostream &out) const } containers.insert(tok->valueType()->container); } - if (!tok->varId() && tok->scope()->isExecutable() && Token::Match(tok, "%name% (")) { + if (!tok->varId() && tok->scope() && tok->scope()->isExecutable() && Token::Match(tok, "%name% (")) { if (mSettings.library.isnoreturn(tok)) outs += " noreturn=\"true\""; }