diff --git a/lib/checkautovariables.cpp b/lib/checkautovariables.cpp index 1f5f66cfc..5f6ce13f9 100644 --- a/lib/checkautovariables.cpp +++ b/lib/checkautovariables.cpp @@ -74,6 +74,8 @@ static bool isRefPtrArg(const Token *tok) static bool isNonReferenceArg(const Token *tok) { const Variable *var = tok->variable(); + if (var && !var->valueType()) + throw InternalError(tok, "var without valueType"); return (var && var->isArgument() && !var->isReference() && (var->isPointer() || var->valueType()->type >= ValueType::Type::CONTAINER || var->type())); } diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 5123befa5..431226edc 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -340,12 +340,13 @@ unsigned int CppCheck::check(const std::string &path) ValueFlow::setValues(&tokenizer.list, const_cast(tokenizer.getSymbolDatabase()), this, &mSettings); if (mSettings.debugnormal) tokenizer.printDebugOutput(1); - #ifdef USE_Z3 if (mSettings.bugHunting) ExprEngine::runChecks(this, &tokenizer, &mSettings); + else #endif - return 0; + checkNormalTokens(tokenizer); + return mExitCode; } std::ifstream fin(path);