diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 04db01b8f71f..552720b60de3 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -138,11 +138,11 @@ static void bailoutInternal(const std::string& type, const TokenList &tokenlist, errorLogger->reportErr(errmsg); } -#define bailout2(type, tokenlist, errorLogger, tok, what) bailoutInternal(type, tokenlist, errorLogger, tok, what, __FILE__, __LINE__, __func__) +#define bailout2(type, tokenlist, errorLogger, tok, what) bailoutInternal((type), (tokenlist), (errorLogger), (tok), (what), __FILE__, __LINE__, __func__) -#define bailout(tokenlist, errorLogger, tok, what) bailout2("valueFlowBailout", tokenlist, errorLogger, tok, what) +#define bailout(tokenlist, errorLogger, tok, what) bailout2("valueFlowBailout", (tokenlist), (errorLogger), (tok), (what)) -#define bailoutIncompleteVar(tokenlist, errorLogger, tok, what) bailoutInternal("valueFlowBailoutIncompleteVar", tokenlist, errorLogger, tok, what, "", 0, __func__) +#define bailoutIncompleteVar(tokenlist, errorLogger, tok, what) bailoutInternal("valueFlowBailoutIncompleteVar", (tokenlist), (errorLogger), (tok), (what), "", 0, __func__) static std::string debugString(const ValueFlow::Value& v) { @@ -2388,7 +2388,7 @@ struct ValueFlowAnalyzer : Analyzer { const Settings* settings; ProgramMemoryState pms; - explicit ValueFlowAnalyzer(const TokenList& t, const Settings* s = nullptr) : tokenlist(t), settings(s), pms(settings) {} + explicit ValueFlowAnalyzer(const TokenList& t, const Settings* s = nullptr) : Analyzer(), tokenlist(t), settings(s), pms(settings) {} virtual const ValueFlow::Value* getValue(const Token* tok) const = 0; virtual ValueFlow::Value* getValue(const Token* tok) = 0; @@ -5555,7 +5555,7 @@ static void valueFlowSymbolicOperators(const SymbolDatabase& symboldatabase, con struct SymbolicInferModel : InferModel { const Token* expr; - explicit SymbolicInferModel(const Token* tok) : expr(tok) { + explicit SymbolicInferModel(const Token* tok) : InferModel(), expr(tok) { assert(expr->exprId() != 0); } bool match(const ValueFlow::Value& value) const override @@ -9415,7 +9415,7 @@ static ValueFlowPassAdaptor makeValueFlowPassAdaptor(const char* name, bool c #define VALUEFLOW_ADAPTOR(cpp, ...) \ makeValueFlowPassAdaptor(#__VA_ARGS__, \ - cpp, \ + (cpp), \ [](TokenList& tokenlist, \ SymbolDatabase& symboldatabase, \ ErrorLogger* errorLogger, \ diff --git a/lib/vfvalue.cpp b/lib/vfvalue.cpp index b07a2c573041..ede4e381bae0 100644 --- a/lib/vfvalue.cpp +++ b/lib/vfvalue.cpp @@ -115,12 +115,14 @@ namespace ValueFlow { case ValueType::LIFETIME: return "lifetime=" + tokvalue->str(); case ValueType::SYMBOLIC: + { std::string result = "symbolic=" + tokvalue->expressionString(); if (intvalue > 0) result += "+" + std::to_string(intvalue); else if (intvalue < 0) result += "-" + std::to_string(-intvalue); return result; + } } throw InternalError(nullptr, "Invalid ValueFlow Value type"); }