Cppcheck
|
#include "valueflow.h"
#include "analyzer.h"
#include "astutils.h"
#include "calculate.h"
#include "checkuninitvar.h"
#include "config.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "findtoken.h"
#include "forwardanalyzer.h"
#include "infer.h"
#include "library.h"
#include "mathlib.h"
#include "path.h"
#include "platform.h"
#include "programmemory.h"
#include "reverseanalyzer.h"
#include "settings.h"
#include "smallvector.h"
#include "sourcelocation.h"
#include "standards.h"
#include "symboldatabase.h"
#include "timer.h"
#include "token.h"
#include "tokenlist.h"
#include "utils.h"
#include "valueptr.h"
#include "vfvalue.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <exception>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Go to the source code of this file.
Classes | |
struct | SingleRange< T > |
class | SelectValueFromVarIdMapRange |
struct | SelectValueFromVarIdMapRange::Iterator |
struct | ValueFlowAnalyzer |
struct | ValueFlowAnalyzer::ConditionState |
struct | SingleValueFlowAnalyzer |
struct | ExpressionAnalyzer |
struct | SameExpressionAnalyzer |
struct | OppositeExpressionAnalyzer |
struct | SubExpressionAnalyzer |
struct | MemberExpressionAnalyzer |
struct | LifetimeStore |
struct | Lambda |
struct | SymbolicInferModel |
struct | ConditionHandler |
struct | ConditionHandler::Condition |
struct | SimpleConditionHandler |
struct | IntegralInferModel |
struct | IteratorInferModel |
struct | EndIteratorInferModel |
struct | StartIteratorInferModel |
struct | SymbolicConditionHandler |
struct | MultiValueFlowAnalyzer |
struct | IteratorRange< Iterator > |
struct | ContainerExpressionAnalyzer |
struct | IteratorConditionHandler |
struct | ContainerConditionHandler |
struct | ValueFlowState |
struct | ValueFlowPass |
struct | ValueFlowPassRunner |
struct | ValueFlowPassAdaptor< F > |
Macros | |
#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 | bailoutIncompleteVar(tokenlist, errorLogger, tok, what) bailoutInternal("valueFlowBailoutIncompleteVar", (tokenlist), (errorLogger), (tok), (what), "", 0, __func__) |
#define | VALUEFLOW_ADAPTOR(cpp, ...) |
#define | VFA(...) VALUEFLOW_ADAPTOR(false, __VA_ARGS__) |
#define | VFA_CPP(...) VALUEFLOW_ADAPTOR(true, __VA_ARGS__) |
Enumerations | |
enum class | LifetimeCapture { Undefined , ByValue , ByReference } |
Functions | |
static void | bailoutInternal (const std::string &type, const TokenList &tokenlist, ErrorLogger &errorLogger, const Token *tok, const std::string &what, const std::string &file, int line, std::string function) |
This is the ValueFlow component in Cppcheck. More... | |
static std::string | debugString (const ValueFlow::Value &v) |
static void | setSourceLocation (ValueFlow::Value &v, SourceLocation ctx, const Token *tok, SourceLocation local=SourceLocation::current()) |
static void | changeKnownToPossible (std::list< ValueFlow::Value > &values, int indirect=-1) |
static void | removeImpossible (std::list< ValueFlow::Value > &values, int indirect=-1) |
static void | lowerToPossible (std::list< ValueFlow::Value > &values, int indirect=-1) |
static void | changePossibleToKnown (std::list< ValueFlow::Value > &values, int indirect=-1) |
static bool | isNonConditionalPossibleIntValue (const ValueFlow::Value &v) |
static void | setValueUpperBound (ValueFlow::Value &value, bool upper) |
static void | setValueBound (ValueFlow::Value &value, const Token *tok, bool invert) |
static void | setConditionalValue (ValueFlow::Value &value, const Token *tok, MathLib::bigint i) |
static void | setConditionalValues (const Token *tok, bool lhs, MathLib::bigint value, ValueFlow::Value &true_value, ValueFlow::Value &false_value) |
static bool | isSaturated (MathLib::bigint value) |
static void | parseCompareEachInt (const Token *tok, const std::function< void(const Token *varTok, ValueFlow::Value true_value, ValueFlow::Value false_value)> &each, const std::function< std::vector< ValueFlow::Value >(const Token *)> &evaluate) |
static void | parseCompareEachInt (const Token *tok, const std::function< void(const Token *varTok, ValueFlow::Value true_value, ValueFlow::Value false_value)> &each) |
static bool | isEscapeScope (const Token *tok, const Settings &settings, bool unknown=false) |
static ValueFlow::Value | castValue (ValueFlow::Value value, const ValueType::Sign sign, nonneg int bit) |
static bool | isNumeric (const ValueFlow::Value &value) |
static const Token * | getCastTypeStartToken (const Token *parent, const Settings &settings) |
static bool | isNonInvertibleOperation (const Token *tok) |
static bool | isComputableValue (const Token *parent, const ValueFlow::Value &value) |
static Library::Container::Yield | getContainerYield (Token *tok, const Settings &settings, Token **parent=nullptr) |
static void | setTokenValueCast (Token *parent, const ValueType &valueType, const ValueFlow::Value &value, const Settings &settings) |
Set token value for cast. More... | |
static bool | isCompatibleValueTypes (ValueFlow::Value::ValueType x, ValueFlow::Value::ValueType y) |
static bool | isCompatibleValues (const ValueFlow::Value &value1, const ValueFlow::Value &value2) |
static ValueFlow::Value | truncateImplicitConversion (Token *parent, const ValueFlow::Value &value, const Settings &settings) |
static long long | truncateIntValue (long long value, size_t value_size, const ValueType::Sign dst_sign) |
static void | setTokenValue (Token *tok, ValueFlow::Value value, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
set ValueFlow value and perform calculations if possible More... | |
template<class F > | |
static size_t | accumulateStructMembers (const Scope *scope, F f) |
static size_t | bitCeil (size_t x) |
static size_t | getAlignOf (const ValueType &vt, const Settings &settings, int maxRecursion=0) |
static nonneg int | getSizeOfType (const Token *typeTok, const Settings &settings) |
static bool | getMinMaxValues (const ValueType *vt, const Platform &platform, MathLib::bigint &minValue, MathLib::bigint &maxValue) |
static Token * | valueFlowSetConstantValue (Token *tok, const Settings &settings) |
static void | valueFlowNumber (TokenList &tokenlist, const Settings &settings) |
static void | valueFlowString (TokenList &tokenlist, const Settings &settings) |
static void | valueFlowArray (TokenList &tokenlist, const Settings &settings) |
static bool | isNonZero (const Token *tok) |
static const Token * | getOtherOperand (const Token *tok) |
static void | valueFlowArrayBool (TokenList &tokenlist, const Settings &settings) |
static void | valueFlowArrayElement (TokenList &tokenlist, const Settings &settings) |
static void | valueFlowPointerAlias (TokenList &tokenlist, const Settings &settings) |
static void | valueFlowBitAnd (TokenList &tokenlist, const Settings &settings) |
static void | valueFlowSameExpressions (TokenList &tokenlist, const Settings &settings) |
static bool | getExpressionRange (const Token *expr, MathLib::bigint *minvalue, MathLib::bigint *maxvalue) |
static void | valueFlowRightShift (TokenList &tokenList, const Settings &settings) |
static std::vector< MathLib::bigint > | minUnsignedValue (const Token *tok, int depth=8) |
static bool | isConvertedToIntegral (const Token *tok, const Settings &settings) |
static bool | isSameToken (const Token *tok1, const Token *tok2) |
static void | valueFlowImpossibleValues (TokenList &tokenList, const Settings &settings) |
static void | valueFlowEnumValue (SymbolDatabase &symboldatabase, const Settings &settings) |
static void | valueFlowGlobalConstVar (TokenList &tokenList, const Settings &settings) |
static void | valueFlowGlobalStaticVar (TokenList &tokenList, const Settings &settings) |
static ValuePtr< Analyzer > | makeAnalyzer (const Token *exprTok, ValueFlow::Value value, const TokenList &tokenlist, const Settings &settings) |
static ValuePtr< Analyzer > | makeReverseAnalyzer (const Token *exprTok, ValueFlow::Value value, const TokenList &tokenlist, const Settings &settings) |
static Analyzer::Result | valueFlowForward (Token *startToken, const Token *endToken, const Token *exprTok, ValueFlow::Value value, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
static Analyzer::Result | valueFlowForward (Token *startToken, const Token *endToken, const Token *exprTok, std::list< ValueFlow::Value > values, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
template<class ValueOrValues > | |
static Analyzer::Result | valueFlowForward (Token *startToken, const Token *exprTok, ValueOrValues v, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
static Analyzer::Result | valueFlowForwardRecursive (Token *top, const Token *exprTok, std::list< ValueFlow::Value > values, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
static void | valueFlowReverse (Token *tok, const Token *const endToken, const Token *const varToken, std::list< ValueFlow::Value > values, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
static void | valueFlowReverse (const TokenList &tokenlist, Token *tok, const Token *const varToken, ValueFlow::Value val, ErrorLogger &errorLogger, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
static bool | isConditionKnown (const Token *tok, bool then) |
static const std::string & | invertAssign (const std::string &assign) |
static std::string | removeAssign (const std::string &assign) |
template<class T , class U > | |
static T | calculateAssign (const std::string &assign, const T &x, const U &y, bool *error=nullptr) |
template<class T , class U > | |
static void | assignValueIfMutable (T &x, const U &y) |
template<class T , class U > | |
static void | assignValueIfMutable (const T &, const U &) |
template<class Value , REQUIRES("Value must ValueFlow::Value", std::is_convertible< Value &, const ValueFlow::Value & >) > | |
static bool | evalAssignment (Value &lhsValue, const std::string &assign, const ValueFlow::Value &rhsValue) |
static ValueFlow::Value::MoveKind | isMoveOrForward (const Token *tok) |
template<class T > | |
static SingleRange< T > | MakeSingleRange (T &x) |
template<typename V > | |
static bool | isAliasOf (const Variable *var, const Token *tok, nonneg int varid, const V &values, bool *inconclusive=nullptr) |
static bool | bifurcate (const Token *tok, const std::set< nonneg int > &varids, const Settings &settings, int depth=20) |
static bool | bifurcateVariableChanged (const Variable *var, const std::set< nonneg int > &varids, const Token *start, const Token *end, const Settings &settings, int depth=20) |
static std::string | lifetimeType (const Token *tok, const ValueFlow::Value *val) |
static bool | hasUniqueOwnership (const Token *tok) |
static bool | derefShared (const Token *tok) |
template<class Predicate > | |
static std::vector< ValueFlow::LifetimeToken > | getLifetimeTokens (const Token *tok, bool escape, ValueFlow::Value::ErrorPath errorPath, Predicate pred, const Settings &settings, int depth=20) |
static const Token * | getLifetimeToken (const Token *tok, ValueFlow::Value::ErrorPath &errorPath, const Settings &settings, bool *addressOf=nullptr) |
static bool | isNotLifetimeValue (const ValueFlow::Value &val) |
static bool | isLifetimeOwned (const ValueType *vtParent) |
static bool | isLifetimeOwned (const ValueType *vt, const ValueType *vtParent) |
static bool | isLifetimeBorrowed (const ValueType *vt, const ValueType *vtParent) |
static const Token * | skipCVRefs (const Token *tok, const Token *endTok) |
static bool | isNotEqual (std::pair< const Token *, const Token * > x, std::pair< const Token *, const Token * > y) |
static bool | isNotEqual (std::pair< const Token *, const Token * > x, const std::string &y, bool cpp) |
static bool | isNotEqual (std::pair< const Token *, const Token * > x, const ValueType *y, bool cpp) |
static bool | isDifferentType (const Token *src, const Token *dst) |
static void | valueFlowLifetimeFunction (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static void | valueFlowLifetimeConstructor (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static bool | isRangeForScope (const Scope *scope) |
static const Token * | getEndOfVarScope (const Variable *var) |
static void | valueFlowForwardLifetime (Token *tok, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static bool | hasBorrowingVariables (const std::list< Variable > &vars, const std::vector< const Token * > &args, int depth=10) |
static void | valueFlowLifetimeUserConstructor (Token *tok, const Function *constructor, const std::string &name, const std::vector< const Token * > &args, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static bool | isScope (const Token *tok) |
static const Function * | findConstructor (const Scope *scope, const Token *tok, const std::vector< const Token * > &args) |
static void | valueFlowLifetimeClassConstructor (Token *tok, const Type *t, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static bool | isDecayedPointer (const Token *tok) |
static bool | isConvertedToView (const Token *tok, const Settings &settings) |
static bool | isContainerOfPointers (const Token *tok, const Settings &settings) |
static void | valueFlowLifetime (TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static bool | isStdMoveOrStdForwarded (Token *tok, ValueFlow::Value::MoveKind *moveKind, Token **varTok=nullptr) |
static bool | isOpenParenthesisMemberFunctionCallOfVarId (const Token *openParenthesisToken, nonneg int varId) |
static Token * | findOpenParentesisOfMove (Token *moveVarTok) |
static Token * | findEndOfFunctionCallForParameter (Token *parameterToken) |
static void | valueFlowAfterMove (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static const Token * | findIncompleteVar (const Token *start, const Token *end) |
static ValueFlow::Value | makeConditionValue (long long val, const Token *condTok, bool assume, bool impossible, const Settings &settings, SourceLocation loc=SourceLocation::current()) |
static std::vector< const Token * > | getConditions (const Token *tok, const char *op) |
static bool | isBreakOrContinueScope (const Token *endToken) |
static const Scope * | getLoopScope (const Token *tok) |
static void | valueFlowConditionExpressions (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static bool | isTruncated (const ValueType *src, const ValueType *dst, const Settings &settings) |
static void | setSymbolic (ValueFlow::Value &value, const Token *tok) |
static ValueFlow::Value | makeSymbolic (const Token *tok, MathLib::bigint delta=0) |
static std::set< nonneg int > | getVarIds (const Token *tok) |
static void | valueFlowSymbolic (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static const Token * | isStrlenOf (const Token *tok, const Token *expr, int depth=10) |
static ValueFlow::Value | inferCondition (const std::string &op, const Token *varTok, MathLib::bigint val) |
static void | valueFlowSymbolicOperators (const SymbolDatabase &symboldatabase, const Settings &settings) |
static void | valueFlowSymbolicInfer (const SymbolDatabase &symboldatabase, const Settings &settings) |
template<class ContainerOfValue > | |
static void | valueFlowForwardConst (Token *start, const Token *end, const Variable *var, const ContainerOfValue &values, const Settings &settings, int=0) |
static void | valueFlowForwardConst (Token *start, const Token *end, const Variable *var, const std::initializer_list< ValueFlow::Value > &values, const Settings &settings) |
static ValueFlow::Value::Bound | findVarBound (const Variable *var, const Token *start, const Token *end, const Settings &settings) |
static bool | isInitialVarAssign (const Token *tok) |
static void | valueFlowForwardAssign (Token *const tok, const Token *expr, std::vector< const Variable * > vars, std::list< ValueFlow::Value > values, const bool init, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static void | valueFlowForwardAssign (Token *const tok, const Variable *const var, const std::list< ValueFlow::Value > &values, const bool, const bool init, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static std::list< ValueFlow::Value > | truncateValues (std::list< ValueFlow::Value > values, const ValueType *dst, const ValueType *src, const Settings &settings) |
static bool | isVariableInit (const Token *tok) |
template<class C1 , class C2 > | |
static bool | intersects (const C1 &c1, const C2 &c2) |
static void | valueFlowAfterAssign (TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings, const std::set< const Scope * > &skippedFunctions) |
static std::vector< const Variable * > | getVariables (const Token *tok) |
static void | valueFlowAfterSwap (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static void | valueFlowSetConditionToKnown (const Token *tok, std::list< ValueFlow::Value > &values, bool then) |
static bool | isBreakScope (const Token *const endToken) |
static void | insertImpossible (std::list< ValueFlow::Value > &values, const std::list< ValueFlow::Value > &input) |
static void | insertNegateKnown (std::list< ValueFlow::Value > &values, const std::list< ValueFlow::Value > &input) |
static void | valueFlowCondition (const ValuePtr< ConditionHandler > &handler, TokenList &tokenlist, SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings, const std::set< const Scope * > &skippedFunctions) |
static bool | isIntegralOnlyOperator (const Token *tok) |
static bool | isIntegralOrPointer (const Token *tok) |
static void | valueFlowInferCondition (TokenList &tokenlist, const Settings &settings) |
static bool | valueFlowForLoop2 (const Token *tok, ProgramMemory *memory1, ProgramMemory *memory2, ProgramMemory *memoryAfter, const Settings &settings) |
static void | valueFlowForLoopSimplify (Token *const bodyStart, const Token *expr, bool globalvar, const MathLib::bigint value, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static void | valueFlowForLoopSimplifyAfter (Token *fortok, nonneg int varid, const MathLib::bigint num, const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static void | valueFlowForLoop (TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
template<class Key , class F > | |
static bool | productParams (const Settings &settings, const std::unordered_map< Key, std::list< ValueFlow::Value >> &vars, F f) |
static void | valueFlowInjectParameter (TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, const Scope *functionScope, const std::unordered_map< const Variable *, std::list< ValueFlow::Value >> &vars) |
static void | valueFlowInjectParameter (const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, const Variable *arg, const Scope *functionScope, const std::list< ValueFlow::Value > &argvalues) |
static void | valueFlowSwitchVariable (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static std::list< ValueFlow::Value > | getFunctionArgumentValues (const Token *argtok) |
static void | valueFlowLibraryFunction (Token *tok, const std::string &returnValue, const Settings &settings) |
template<class Iterator > | |
static IteratorRange< Iterator > | MakeIteratorRange (Iterator start, Iterator last) |
static void | valueFlowSubFunction (TokenList &tokenlist, SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static void | valueFlowFunctionDefaultParameter (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static const ValueFlow::Value * | getKnownValueFromToken (const Token *tok) |
static const ValueFlow::Value * | getKnownValueFromTokens (const std::vector< const Token * > &toks) |
static void | setFunctionReturnValue (const Function *f, Token *tok, ValueFlow::Value v, const Settings &settings) |
static void | valueFlowFunctionReturn (TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static bool | needsInitialization (const Variable *var) |
static void | addToErrorPath (ValueFlow::Value &value, const ValueFlow::Value &from) |
static std::vector< Token * > | findAllUsages (const Variable *var, Token *start, const Library &library) |
static Token * | findStartToken (const Variable *var, Token *start, const Library &library) |
static void | valueFlowUninit (TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static bool | isContainerSizeChanged (const Token *expr, const Token *start, const Token *end, int indirect, const Settings &settings, int depth=20) |
static bool | isContainerSizeChangedByFunction (const Token *tok, int indirect, const Settings &settings, int depth=20) |
static const Token * | parseBinaryIntOp (const Token *expr, const std::function< std::vector< MathLib::bigint >(const Token *)> &eval, MathLib::bigint &known) |
static const Token * | solveExprValue (const Token *expr, ValueFlow::Value &value) |
static void | valueFlowSmartPointer (TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
static Library::Container::Yield | findIteratorYield (Token *tok, const Token **ftok, const Settings &settings) |
static void | valueFlowIterators (TokenList &tokenlist, const Settings &settings) |
static std::list< ValueFlow::Value > | getIteratorValues (std::list< ValueFlow::Value > values, const ValueFlow::Value::ValueKind *kind=nullptr) |
static void | valueFlowIteratorInfer (TokenList &tokenlist, const Settings &settings) |
static std::vector< ValueFlow::Value > | getContainerValues (const Token *tok) |
static ValueFlow::Value | makeContainerSizeValue (std::size_t s, bool known=true) |
static std::vector< ValueFlow::Value > | makeContainerSizeValue (const Token *tok, bool known=true) |
static std::vector< ValueFlow::Value > | getContainerSizeFromConstructorArgs (const std::vector< const Token * > &args, const Library::Container *container, bool known) |
static bool | valueFlowIsSameContainerType (const ValueType &contType, const Token *tok, const Settings &settings) |
static std::vector< ValueFlow::Value > | getInitListSize (const Token *tok, const ValueType *valueType, const Settings &settings, bool known=true) |
static std::vector< ValueFlow::Value > | getContainerSizeFromConstructor (const Token *tok, const ValueType *valueType, const Settings &settings, bool known=true) |
static void | valueFlowContainerSetTokValue (const TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings, const Token *tok, Token *initList) |
static const Scope * | getFunctionScope (const Scope *scope) |
static MathLib::bigint | valueFlowGetStrLength (const Token *tok) |
static void | valueFlowContainerSize (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings, const std::set< const Scope * > &skippedFunctions) |
static void | valueFlowDynamicBufferSize (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static bool | getMinMaxValues (const std::string &typestr, const Settings &settings, bool cpp, MathLib::bigint &minvalue, MathLib::bigint &maxvalue) |
static void | valueFlowSafeFunctions (const TokenList &tokenlist, const SymbolDatabase &symboldatabase, ErrorLogger &errorLogger, const Settings &settings) |
static void | valueFlowUnknownFunctionReturn (TokenList &tokenlist, const Settings &settings) |
static void | valueFlowDebug (TokenList &tokenlist, ErrorLogger &errorLogger, const Settings &settings) |
template<class F > | |
static ValueFlowPassAdaptor< F > | makeValueFlowPassAdaptor (const char *name, bool cpp, F run) |
static std::vector< ValueFlow::Value > | isOutOfBoundsImpl (const ValueFlow::Value &size, const Token *indexTok, bool condition) |
#define bailout | ( | tokenlist, | |
errorLogger, | |||
tok, | |||
what | |||
) | bailout2("valueFlowBailout", (tokenlist), (errorLogger), (tok), (what)) |
Definition at line 144 of file valueflow.cpp.
#define bailout2 | ( | type, | |
tokenlist, | |||
errorLogger, | |||
tok, | |||
what | |||
) | bailoutInternal((type), (tokenlist), (errorLogger), (tok), (what), __FILE__, __LINE__, __func__) |
Definition at line 142 of file valueflow.cpp.
#define bailoutIncompleteVar | ( | tokenlist, | |
errorLogger, | |||
tok, | |||
what | |||
) | bailoutInternal("valueFlowBailoutIncompleteVar", (tokenlist), (errorLogger), (tok), (what), "", 0, __func__) |
Definition at line 146 of file valueflow.cpp.
#define VALUEFLOW_ADAPTOR | ( | cpp, | |
... | |||
) |
Definition at line 9585 of file valueflow.cpp.
#define VFA | ( | ... | ) | VALUEFLOW_ADAPTOR(false, __VA_ARGS__) |
Definition at line 9601 of file valueflow.cpp.
#define VFA_CPP | ( | ... | ) | VALUEFLOW_ADAPTOR(true, __VA_ARGS__) |
Definition at line 9602 of file valueflow.cpp.
|
strong |
Enumerator | |
---|---|
Undefined | |
ByValue | |
ByReference |
Definition at line 3462 of file valueflow.cpp.
|
static |
Definition at line 1121 of file valueflow.cpp.
References Variable::dimensions(), Variable::isStatic(), Variable::nameToken(), Token::scope(), Variable::valueType(), and Scope::varlist.
Referenced by getAlignOf(), and ValueFlow::getSizeOf().
|
static |
Definition at line 8030 of file valueflow.cpp.
References ValueFlow::Value::condition, and ValueFlow::Value::errorPath.
Referenced by valueFlowUninit().
|
static |
Definition at line 2308 of file valueflow.cpp.
|
static |
Definition at line 2302 of file valueflow.cpp.
Referenced by evalAssignment().
|
static |
This is the ValueFlow component in Cppcheck.
Each
In the –debug and –debug-normal output you can see the ValueFlow data. For example:
int f() { int x = 10; return 4 * x + 2; }
The –debug-normal output says:
##Value flow Line 3 10 always 10 Line 4 4 always 4 * always 40 x always 10 + always 42 2 always 2
All value flow analysis is executed in the ValueFlow::setValues() function. The ValueFlow analysis is executed after the tokenizer/ast/symboldatabase/etc.. The ValueFlow analysis is done in a series of valueFlow* function calls, where each such function call can only use results from previous function calls. The function calls should be arranged so that valueFlow* that do not require previous ValueFlow information should be first.
This is "flow sensitive" value flow analysis. We usually track the value for 1 variable at a time.
Here is an example code:
x = 3 + 4;
The valueFlowNumber set the values for the "3" and "4" tokens by calling setTokenValue(). The setTokenValue() handle the calculations automatically. When both "3" and "4" have values, the "+" can be calculated. setTokenValue() recursively calls itself when parents in calculations can be calculated.
In forward value flow analysis we know a value and see what happens when we are stepping the program forward. Like normal execution. The valueFlowForward is used in this analysis.
In reverse value flow analysis we know the value of a variable at line X. And try to "execute backwards" to determine possible values before line X. The valueFlowReverse is used in this analysis.
Definition at line 131 of file valueflow.cpp.
References debug, TokenList::getSourceFilePath(), normal, ErrorLogger::reportErr(), and Path::stripDirectoryPart().
|
static |
Definition at line 2470 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), bifurcateVariableChanged(), Variable::declarationId(), Variable::declEndToken(), Token::hasKnownIntValue(), Variable::isArgument(), Variable::isConst(), Token::isConstOp(), Token::Match(), Token::strAt(), Token::tokAt(), Token::variable(), and Token::varId().
Referenced by bifurcateVariableChanged(), SingleValueFlowAnalyzer::updateScope(), and MultiValueFlowAnalyzer::updateScope().
|
static |
Definition at line 2449 of file valueflow.cpp.
References Token::astParent(), bifurcate(), Variable::declarationId(), findVariableChanged(), Variable::isGlobal(), Variable::isPointer(), Token::Match(), and Token::next().
Referenced by bifurcate().
|
static |
Definition at line 1148 of file valueflow.cpp.
Referenced by getAlignOf().
|
static |
Definition at line 2289 of file valueflow.cpp.
References error, and removeAssign().
Referenced by evalAssignment().
|
static |
Definition at line 400 of file valueflow.cpp.
References MathLib::bigint_bits, ValueFlow::Value::floatValue, ValueFlow::Value::INT, ValueFlow::Value::intvalue, ValueFlow::Value::isFloatValue(), sign(), and ValueFlow::Value::valueType.
Referenced by setTokenValueCast(), and truncateImplicitConversion().
|
static |
Definition at line 180 of file valueflow.cpp.
References ValueFlow::Value::changeKnownToPossible(), and ValueFlow::Value::indirect.
Referenced by ConditionHandler::afterCondition(), and lowerToPossible().
|
static |
Definition at line 204 of file valueflow.cpp.
References ValueFlow::Value::bound, ValueFlow::Value::indirect, ValueFlow::Value::isPossible(), ValueFlow::Value::Point, and ValueFlow::Value::setKnown().
Referenced by ConditionHandler::afterCondition(), and valueFlowSetConditionToKnown().
|
static |
Definition at line 148 of file valueflow.cpp.
References ValueFlow::Value::Impossible, ValueFlow::Value::Inconclusive, ValueFlow::Value::Known, ValueFlow::Value::Possible, ValueFlow::Value::toString(), and ValueFlow::Value::valueKind.
Referenced by setSourceLocation(), and valueFlowDebug().
|
static |
Definition at line 3563 of file valueflow.cpp.
References Token::astOperand1(), hasUniqueOwnership(), Token::isUnaryOp(), Token::originalName(), and Token::str().
Referenced by getLifetimeTokens(), and valueFlowLifetimeFunction().
|
static |
Definition at line 2312 of file valueflow.cpp.
References assignValueIfMutable(), calculateAssign(), error, ValueFlow::Value::intvalue, and ValueFlow::Value::isIntValue().
Referenced by ValueFlowAnalyzer::isWritable(), and ValueFlowAnalyzer::writeValue().
|
static |
Definition at line 8049 of file valueflow.cpp.
References Scope::bodyEnd, findTokensSkipDeadCode(), and Variable::scope().
Referenced by findStartToken().
|
static |
Definition at line 4669 of file valueflow.cpp.
References Token::astOperand1(), Token::function(), Scope::functionList, and Function::isConstructor().
Referenced by valueFlowLifetimeClassConstructor().
Definition at line 5239 of file valueflow.cpp.
References Token::astParent(), Token::isOp(), Token::Match(), and nextAfterAstRightmostLeaf().
Referenced by valueFlowAfterMove().
Definition at line 5332 of file valueflow.cpp.
References Token::isIncompleteVar(), and Token::next().
Referenced by valueFlowConditionExpressions().
|
static |
Definition at line 8588 of file valueflow.cpp.
References astContainerYield(), astFunctionYield(), and Token::astParent().
Referenced by valueFlowIterators().
Definition at line 5231 of file valueflow.cpp.
References Token::previous(), and Token::str().
Referenced by valueFlowAfterMove().
|
static |
Definition at line 8062 of file valueflow.cpp.
References Token::astParent(), Scope::bodyStart, findAllUsages(), Token::findmatch(), Token::linkAt(), Token::Match(), Variable::nameToken(), Scope::nestedIn, precedes(), Token::previous(), Variable::scope(), Token::scope(), Token::simpleMatch(), and Token::tokAt().
Referenced by valueFlowUninit().
|
static |
Definition at line 5852 of file valueflow.cpp.
References Token::astParent(), Variable::declarationId(), evaluateKnownValues(), findExpressionChangedSkipDeadCode(), ValueFlow::Value::Lower, Variable::nameToken(), Token::next(), ValueFlow::Value::Point, Token::simpleMatch(), ValueFlow::Value::Upper, and Token::varId().
Referenced by valueFlowForwardAssign().
|
static |
Definition at line 1162 of file valueflow.cpp.
References accumulateStructMembers(), bitCeil(), Scope::definedType, ValueFlow::getSizeOf(), ValueType::isPrimitive(), None, Settings::platform, ValueType::pointer, ValueType::reference, Platform::sizeof_pointer, ValueType::type, and ValueType::typeScope.
Referenced by ValueFlow::getSizeOf().
|
static |
Definition at line 467 of file valueflow.cpp.
References astIsPrimitive(), Token::astOperand1(), Token::astOperand2(), Token::eType, Token::isBinaryOp(), Library::isNotLibraryFunction(), Token::isStandardType(), Settings::library, Token::Match(), Token::next(), Token::simpleMatch(), Token::str(), and Token::tokAt().
Referenced by setTokenValue().
Definition at line 5364 of file valueflow.cpp.
References astFlatten(), and Token::str().
Referenced by valueFlowConditionExpressions().
|
static |
Definition at line 8812 of file valueflow.cpp.
References ValueType::container, getArguments(), getContainerSizeFromConstructorArgs(), getInitListSize(), makeContainerSizeValue(), and Token::simpleMatch().
Referenced by valueFlowContainerSize().
|
static |
Definition at line 8725 of file valueflow.cpp.
References astIsContainer(), astIsIntegral(), astIsPointer(), Token::astOperand1(), Token::astOperand2(), Token::exprId(), getContainerValues(), Token::hasKnownIntValue(), isIteratorPair(), makeContainerSizeValue(), nonneg, Token::simpleMatch(), and Library::Container::stdStringLike.
Referenced by getContainerSizeFromConstructor(), and getInitListSize().
|
static |
Definition at line 8697 of file valueflow.cpp.
References ValueFlow::Value::isContainerSizeValue(), and Token::values().
Referenced by getContainerSizeFromConstructorArgs().
|
static |
Definition at line 514 of file valueflow.cpp.
References Token::astOperand1(), Token::astParent(), Library::getFunction(), getLibraryContainer(), Library::Container::getYield(), Settings::library, Token::Match(), Library::Container::NO_YIELD, Token::previous(), Token::strAt(), and Token::tokAt().
Referenced by setTokenValue().
Definition at line 3951 of file valueflow.cpp.
References Scope::bodyEnd, Scope::isExecutable(), Scope::isLoopScope(), isRangeForScope(), Token::next(), Variable::scope(), Token::scope(), and Variable::typeStartToken().
|
static |
Definition at line 1790 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::hasKnownIntValue(), Token::str(), and Token::values().
Referenced by valueFlowRightShift().
|
static |
Definition at line 7734 of file valueflow.cpp.
References Token::Match(), removeImpossible(), and Token::values().
Referenced by valueFlowLibraryFunction(), and valueFlowSubFunction().
Definition at line 8843 of file valueflow.cpp.
References Scope::nestedIn, and Scope::type.
Referenced by valueFlowContainerSize().
|
static |
Definition at line 8780 of file valueflow.cpp.
References astIsGenericChar(), astIsIntegral(), astIsIterator(), astIsPointer(), Token::astOperand2(), ValueType::container, ValueType::containerTypeToken, getArguments(), getContainerSizeFromConstructorArgs(), ValueType::isIntegral(), isIteratorPair(), ValueType::ITERATOR, makeContainerSizeValue(), ValueType::parseDecl(), ValueType::pointer, Library::Container::stdStringLike, ValueType::type, and valueFlowIsSameContainerType().
Referenced by getContainerSizeFromConstructor(), and valueFlowContainerSize().
|
static |
Definition at line 8626 of file valueflow.cpp.
References ValueFlow::Value::isIteratorValue(), and ValueFlow::Value::valueKind.
Referenced by IteratorConditionHandler::parse(), and valueFlowIteratorInfer().
|
static |
Definition at line 7907 of file valueflow.cpp.
References Token::values().
Referenced by getKnownValueFromTokens(), and valueFlowFunctionReturn().
|
static |
Definition at line 7919 of file valueflow.cpp.
References getKnownValueFromToken().
Referenced by valueFlowFunctionReturn().
|
static |
Definition at line 3752 of file valueflow.cpp.
References ValueFlow::getLifetimeTokens().
Referenced by ValueFlow::getLifetimeVariable().
|
static |
Definition at line 3585 of file valueflow.cpp.
References astIsContainer(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), Library::Container::AT_INDEX, Variable::declarationId(), Variable::declEndToken(), derefShared(), exprDependsOnThis(), Token::expressionString(), Function::findReturns(), Token::function(), getArgumentPos(), getArguments(), getArgumentStart(), getLibraryContainer(), getParentValueTypes(), Library::Container::getYield(), Variable::isArgument(), Variable::isConst(), Variable::isGlobal(), Variable::isReference(), Variable::isRValueReference(), Variable::isStatic(), isTemporary(), Token::isUnaryOp(), Library::Container::ITEM, Token::Match(), Variable::nameToken(), Token::originalName(), Token::previous(), Function::returnsReference(), ValueFlow::LifetimeToken::setAddressOf(), ValueFlow::LifetimeToken::setInconclusive(), Token::simpleMatch(), Token::str(), Token::tokAt(), Token::values(), Token::variable(), and Token::varId().
Referenced by ValueFlow::getLifetimeTokens(), and ValueFlow::hasLifetimeToken().
Definition at line 5389 of file valueflow.cpp.
References Scope::eDo, Scope::eFor, Scope::eWhile, Scope::nestedIn, Token::scope(), and Scope::type.
Referenced by ConditionHandler::afterCondition(), and valueFlowConditionExpressions().
|
static |
Definition at line 9250 of file valueflow.cpp.
References TokenList::createTokens(), TokenList::front(), getMinMaxValues(), ValueType::parseDecl(), Settings::platform, TokenList::simplifyPlatformTypes(), and TokenList::simplifyStdType().
|
static |
Definition at line 9195 of file valueflow.cpp.
References Platform::char_bit, Platform::int_bit, ValueType::isIntegral(), Platform::long_bit, Platform::long_long_bit, ValueType::pointer, Platform::short_bit, ValueType::sign, and ValueType::type.
Referenced by getMinMaxValues(), valueFlowSafeFunctions(), valueFlowSetConstantValue(), and valueFlowUnknownFunctionReturn().
Definition at line 1569 of file valueflow.cpp.
References Token::astParent().
Referenced by valueFlowArrayBool().
Definition at line 1190 of file valueflow.cpp.
References ValueFlow::getSizeOf(), and ValueType::parseDecl().
Referenced by valueFlowSetConstantValue().
Definition at line 6209 of file valueflow.cpp.
References op1_and_op2, Token::variable(), and visitAstNodes().
Referenced by valueFlowAfterSwap(), and valueFlowSmartPointer().
Definition at line 5530 of file valueflow.cpp.
References op1_and_op2, Token::varId(), and visitAstNodes().
Referenced by valueFlowSymbolic().
|
static |
Definition at line 4384 of file valueflow.cpp.
Referenced by valueFlowLifetimeUserConstructor().
|
static |
Definition at line 3546 of file valueflow.cpp.
References astIsContainerOwned(), astIsPointer(), astIsUniqueSmartPointer(), Variable::isArgument(), Variable::isArray(), and Token::variable().
Referenced by derefShared().
|
static |
Definition at line 6981 of file valueflow.cpp.
References Token::hasKnownIntValue(), infer(), and Token::values().
Referenced by ValueFlow::isOutOfBounds(), isOutOfBoundsImpl(), and valueFlowSymbolicOperators().
|
static |
Definition at line 6276 of file valueflow.cpp.
References ValueFlow::asImpossible().
Referenced by ConditionHandler::Condition::getContextAndValues().
|
static |
Definition at line 6281 of file valueflow.cpp.
References ValueFlow::Value::intvalue, ValueFlow::Value::isContainerSizeValue(), ValueFlow::Value::isIntValue(), and ValueFlow::Value::setKnown().
Referenced by ConditionHandler::Condition::getContextAndValues().
|
static |
Definition at line 6071 of file valueflow.cpp.
Referenced by valueFlowAfterAssign().
|
static |
Definition at line 2267 of file valueflow.cpp.
References emptyString.
Referenced by ValueFlowAnalyzer::getAssign().
|
static |
Definition at line 2421 of file valueflow.cpp.
References inconclusive, Variable::isPointer(), and Token::varId().
Referenced by SingleValueFlowAnalyzer::isAlias(), MultiValueFlowAnalyzer::isAlias(), isContainerSizeChanged(), and ContainerExpressionAnalyzer::match().
|
static |
Definition at line 5382 of file valueflow.cpp.
References Token::Match(), Token::simpleMatch(), and Token::tokAt().
Referenced by ConditionHandler::afterCondition(), and valueFlowConditionExpressions().
|
static |
Definition at line 6260 of file valueflow.cpp.
References Token::findmatch(), Token::link(), and Token::simpleMatch().
Referenced by ConditionHandler::afterCondition().
|
static |
Definition at line 559 of file valueflow.cpp.
References Token::exprId(), isCompatibleValueTypes(), ValueFlow::Value::isImpossible(), ValueFlow::Value::isIntValue(), ValueFlow::Value::isKnown(), ValueFlow::Value::isSymbolicValue(), ValueFlow::Value::tokvalue, ValueFlow::Value::valueType, ValueFlow::Value::varId, and ValueFlow::Value::varvalue.
|
static |
Definition at line 536 of file valueflow.cpp.
References ValueFlow::Value::FLOAT, ValueFlow::Value::INT, ValueFlow::Value::ITERATOR_END, ValueFlow::Value::ITERATOR_START, ValueFlow::Value::SYMBOLIC, and ValueFlow::Value::TOK.
Referenced by isCompatibleValues().
|
static |
Definition at line 500 of file valueflow.cpp.
References Token::isComparisonOp(), ValueFlow::Value::isFloatValue(), ValueFlow::Value::isImpossible(), ValueFlow::Value::isIntValue(), ValueFlow::Value::isIteratorValue(), isNonInvertibleOperation(), ValueFlow::Value::isTokValue(), Token::Match(), and ValueFlow::Value::tokvalue.
|
static |
Definition at line 2253 of file valueflow.cpp.
References Token::astParent(), Token::astTop(), Token::isCast(), Token::Match(), Token::previous(), Token::simpleMatch(), and Token::str().
Referenced by ConditionHandler::Condition::getContextAndValues(), and valueFlowSetConditionToKnown().
Definition at line 4907 of file valueflow.cpp.
References ValueType::parseDecl(), and ValueType::pointer.
Referenced by valueFlowLifetime().
|
static |
Definition at line 8497 of file valueflow.cpp.
References Token::exprId(), isAliasOf(), ValueFlow::isContainerSizeChanged(), and Token::next().
Referenced by isContainerSizeChangedByFunction().
|
static |
Definition at line 8201 of file valueflow.cpp.
References astIsContainer(), Token::astParent(), Scope::bodyEnd, Scope::bodyStart, ValueType::constness, Token::function(), Function::functionScope, Function::getArgumentVar(), getLibraryContainer(), getTokenArgumentFunction(), Library::Container::getYield(), inconclusive, Variable::isConst(), isContainerSizeChanged(), Function::isImplicitlyVirtual(), Variable::isReference(), isVariableChangedByFunctionCall(), Token::Match(), Variable::nameToken(), Library::Container::NO_YIELD, ValueType::pointer, Token::simpleMatch(), Token::strAt(), Variable::valueType(), and Token::valueType().
Referenced by ValueFlow::isContainerSizeChanged().
Definition at line 1915 of file valueflow.cpp.
References getParentValueTypes(), ValueType::isIntegral(), ValueType::type, and ValueType::UNKNOWN_INT.
Referenced by valueFlowImpossibleValues().
Definition at line 4897 of file valueflow.cpp.
References getParentValueTypes().
Referenced by valueFlowLifetime().
|
static |
Definition at line 4882 of file valueflow.cpp.
References astIsPointer(), Token::astParent(), and Token::simpleMatch().
Referenced by valueFlowLifetime().
Definition at line 3887 of file valueflow.cpp.
References Type::classDef, Token::isCpp(), isNotEqual(), Token::typeDecl(), Token::typeOf(), and Token::valueType().
Referenced by ValueFlow::isLifetimeBorrowed(), and valueFlowSymbolic().
|
static |
Definition at line 386 of file valueflow.cpp.
References Token::findmatch(), Library::isScopeNoReturn(), Settings::library, Token::link(), Token::scope(), and Token::simpleMatch().
Referenced by valueFlowConditionExpressions().
|
static |
Definition at line 5878 of file valueflow.cpp.
References Token::Match(), Token::tokAt(), Token::variable(), and Token::varId().
Referenced by valueFlowForwardAssign().
|
static |
Definition at line 7019 of file valueflow.cpp.
References Token::Match().
Referenced by isIntegralOrPointer().
|
static |
Definition at line 7023 of file valueflow.cpp.
References astIsIntegral(), astIsPointer(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), Token::isBinaryOp(), isIntegralOnlyOperator(), Token::Match(), and Token::valueType().
Referenced by valueFlowInferCondition().
Definition at line 3816 of file valueflow.cpp.
References ValueType::container, ValueType::isIntegral(), ValueType::pointer, ValueType::str(), ValueType::type, ValueType::UNKNOWN_TYPE, and Library::Container::view.
Referenced by ValueFlow::isLifetimeBorrowed().
Definition at line 3791 of file valueflow.cpp.
References isLifetimeOwned(), ValueType::ITERATOR, ValueType::pointer, ValueType::RECORD, ValueType::type, and ValueType::UNKNOWN_TYPE.
|
static |
Definition at line 3784 of file valueflow.cpp.
References ValueType::CONTAINER, ValueType::container, ValueType::type, and Library::Container::view.
Referenced by ValueFlow::isLifetimeBorrowed(), and isLifetimeOwned().
|
static |
Definition at line 2330 of file valueflow.cpp.
References Token::astOperand1(), Token::astParent(), ValueFlow::Value::ForwardedVariable, ValueFlow::Value::MovedVariable, ValueFlow::Value::NonMovedVariable, and Token::simpleMatch().
Referenced by ValueFlowAnalyzer::isModified().
|
static |
Definition at line 217 of file valueflow.cpp.
References ValueFlow::Value::condition, ValueFlow::Value::conditional, ValueFlow::Value::isIntValue(), and ValueFlow::Value::isPossible().
|
static |
Definition at line 495 of file valueflow.cpp.
References Token::Match().
Referenced by isComputableValue().
|
static |
Definition at line 1564 of file valueflow.cpp.
References Token::hasKnownIntValue(), and Token::values().
Referenced by valueFlowArrayBool().
|
static |
Definition at line 3871 of file valueflow.cpp.
References TokenList::back(), TokenList::createTokens(), TokenList::front(), and isNotEqual().
|
static |
Definition at line 3878 of file valueflow.cpp.
References isNotEqual(), and ValueType::originalTypeName.
|
static |
Definition at line 3845 of file valueflow.cpp.
References Token::next(), skipCVRefs(), and Token::str().
Referenced by isDifferentType(), and isNotEqual().
|
static |
Definition at line 3779 of file valueflow.cpp.
References ValueFlow::Value::isLifetimeValue().
Referenced by valueFlowForwardLifetime().
|
static |
Definition at line 420 of file valueflow.cpp.
References ValueFlow::Value::isFloatValue(), and ValueFlow::Value::isIntValue().
Referenced by setTokenValueCast().
|
static |
Definition at line 5224 of file valueflow.cpp.
References Token::Match(), Token::next(), Token::originalName(), and Token::tokAt().
Referenced by valueFlowAfterMove().
|
static |
Definition at line 9719 of file valueflow.cpp.
References ValueFlow::Value::bound, Token::getMaxValue(), inferCondition(), ValueFlow::Value::intvalue, ValueFlow::Value::isKnown(), ValueFlow::Value::Lower, ValueFlow::Value::path, Token::values(), and Token::variable().
Referenced by ValueFlow::isOutOfBounds().
|
static |
Definition at line 3938 of file valueflow.cpp.
References Token::astOperand2(), Scope::bodyStart, Scope::eFor, Token::linkAt(), Token::previous(), Token::simpleMatch(), and Scope::type.
Referenced by getEndOfVarScope().
Definition at line 1926 of file valueflow.cpp.
References Token::exprId(), Token::hasKnownIntValue(), and Token::values().
Referenced by valueFlowImpossibleValues().
|
static |
Definition at line 291 of file valueflow.cpp.
Referenced by parseCompareEachInt().
|
static |
Definition at line 4655 of file valueflow.cpp.
References Scope::bodyStart, Token::scope(), and Token::simpleMatch().
Referenced by valueFlowLifetime(), valueFlowLifetimeClassConstructor(), and valueFlowLifetimeConstructor().
|
static |
Definition at line 5194 of file valueflow.cpp.
References ValueFlow::Value::ForwardedVariable, Token::link(), Token::Match(), ValueFlow::Value::MovedVariable, ValueFlow::Value::NonMovedVariable, Token::simpleMatch(), Token::str(), Token::strAt(), Token::tokAt(), ValueType::type, and Token::valueType().
Referenced by valueFlowAfterMove().
Definition at line 5604 of file valueflow.cpp.
References Token::astOperand2(), Token::exprId(), Token::previous(), Token::simpleMatch(), and Token::values().
Referenced by valueFlowSymbolicOperators().
|
static |
Definition at line 5492 of file valueflow.cpp.
References ValueFlow::getSizeOf(), ValueType::isFloat(), ValueType::isIntegral(), ValueType::pointer, ValueType::sign, ValueType::smartPointer, ValueType::type, and ValueType::typeScope.
Referenced by valueFlowSymbolic().
|
static |
Definition at line 6058 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::isBinaryOp(), Token::link(), Token::next(), Token::simpleMatch(), and Token::str().
Referenced by valueFlowAfterAssign().
|
static |
Definition at line 3464 of file valueflow.cpp.
References ValueFlow::Value::Address, astIsPointer(), Token::astOperand2(), ValueFlow::Value::Iterator, ValueFlow::Value::Lambda, ValueFlow::Value::lifetimeKind, ValueFlow::Value::Object, Token::simpleMatch(), and ValueFlow::Value::SubObject.
Referenced by ValueFlow::lifetimeMessage(), and valueFlowLifetimeFunction().
|
static |
Definition at line 198 of file valueflow.cpp.
References changeKnownToPossible(), and removeImpossible().
Referenced by valueFlowForwardAssign(), and valueFlowSubFunction().
|
static |
Definition at line 8446 of file valueflow.cpp.
References ValueFlow::Value::isContainerSizeValue(), and solveExprValue().
Referenced by SingleValueFlowAnalyzer::reanalyze(), valueFlowForward(), and valueFlowForwardRecursive().
|
static |
Definition at line 5341 of file valueflow.cpp.
References ValueFlow::Value::condition, Settings::debugnormal, ValueFlow::Value::errorPath, Token::expressionString(), ValueFlow::Value::intvalue, ValueFlow::Value::setImpossible(), ValueFlow::Value::setKnown(), and setSourceLocation().
Referenced by valueFlowConditionExpressions().
|
static |
Definition at line 8718 of file valueflow.cpp.
References Token::hasKnownIntValue(), makeContainerSizeValue(), and Token::values().
|
static |
Definition at line 8709 of file valueflow.cpp.
References ValueFlow::Value::CONTAINER_SIZE, ValueFlow::Value::setKnown(), and ValueFlow::Value::valueType.
Referenced by getContainerSizeFromConstructor(), getContainerSizeFromConstructorArgs(), getInitListSize(), and makeContainerSizeValue().
|
static |
Definition at line 7792 of file valueflow.cpp.
Referenced by valueFlowSubFunction().
|
static |
Definition at line 8454 of file valueflow.cpp.
References ValueFlow::Value::isContainerSizeValue().
Referenced by valueFlowReverse().
|
static |
Definition at line 2360 of file valueflow.cpp.
Referenced by SingleValueFlowAnalyzer::isAlias().
|
static |
Definition at line 5521 of file valueflow.cpp.
References ValueFlow::Value::intvalue, ValueFlow::Value::setKnown(), and setSymbolic().
Referenced by valueFlowSmartPointer(), valueFlowSymbolic(), and valueFlowSymbolicOperators().
|
static |
Definition at line 9580 of file valueflow.cpp.
References ValueFlowPass::cpp(), ValueFlowPass::name(), and ValueFlowPass::run().
|
static |
Definition at line 1894 of file valueflow.cpp.
References astIsUnsigned(), Token::astOperand1(), Token::astOperand2(), Token::hasKnownIntValue(), Token::isConstOp(), Token::Match(), op1, op2, Token::str(), and Token::values().
Referenced by valueFlowImpossibleValues().
|
static |
Definition at line 8005 of file valueflow.cpp.
References Variable::hasDefault(), Token::isCpp(), Variable::isPointer(), ValueType::isPrimitive(), Type::isUnionType(), Variable::nameToken(), Type::needInitialization, Type::True, Variable::type(), ValueType::type, and Variable::valueType().
Referenced by valueFlowUninit().
|
static |
Definition at line 8365 of file valueflow.cpp.
References Token::astOperand1(), and Token::astOperand2().
Referenced by ValueFlow::solveExprValue().
|
static |
Definition at line 331 of file valueflow.cpp.
References Token::hasKnownIntValue(), parseCompareEachInt(), and Token::values().
|
static |
Definition at line 296 of file valueflow.cpp.
References astIsFloat(), Token::astOperand1(), Token::astOperand2(), evaluate(), Token::isComparisonOp(), isSaturated(), and setConditionalValues().
Referenced by SimpleConditionHandler::parse(), ContainerConditionHandler::parse(), parseCompareEachInt(), and ValueFlow::parseCompareInt().
|
static |
Definition at line 7560 of file valueflow.cpp.
References Settings::performanceValueFlowMaxSubFunctionArgs.
Referenced by valueFlowInjectParameter(), and valueFlowLibraryFunction().
|
static |
Definition at line 2284 of file valueflow.cpp.
Referenced by calculateAssign().
|
static |
Definition at line 189 of file valueflow.cpp.
References ValueFlow::Value::indirect, and ValueFlow::Value::isImpossible().
Referenced by getFunctionArgumentValues(), and lowerToPossible().
|
static |
Definition at line 247 of file valueflow.cpp.
References ValueFlow::Value::assumeCondition(), ValueFlow::Value::intvalue, ValueFlow::Value::isIntValue(), and ValueFlow::Value::setPossible().
Referenced by setConditionalValues().
|
static |
Definition at line 255 of file valueflow.cpp.
References Token::Match(), setConditionalValue(), setValueBound(), and Token::simpleMatch().
Referenced by SymbolicConditionHandler::parse(), and parseCompareEachInt().
|
static |
Definition at line 7935 of file valueflow.cpp.
References ValueFlow::Value::errorPath, Function::hasVirtualSpecifier(), ValueFlow::Value::isImpossible(), Function::name(), ValueFlow::Value::setKnown(), ValueFlow::Value::setPossible(), setTokenValue(), and ValueFlow::Value::toString().
Referenced by valueFlowFunctionReturn().
|
static |
Definition at line 167 of file valueflow.cpp.
References ValueFlow::Value::debugPath, debugString(), SourceLocation::file_name(), SourceLocation::function_name(), SourceLocation::line(), and Path::stripDirectoryPart().
Referenced by LifetimeStore::byRef(), LifetimeStore::byVal(), makeConditionValue(), setTokenValue(), valueFlowForward(), valueFlowForwardRecursive(), and valueFlowReverse().
|
static |
Definition at line 5514 of file valueflow.cpp.
References Token::exprId(), ValueFlow::Value::SYMBOLIC, ValueFlow::Value::tokvalue, and ValueFlow::Value::valueType.
Referenced by makeSymbolic(), and SymbolicConditionHandler::parse().
|
static |
set ValueFlow value and perform calculations if possible
Definition at line 619 of file valueflow.cpp.
References Token::addValue(), astIsContainer(), astIsIterator(), astIsPointer(), astIsRHS(), astIsUnsigned(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), ValueFlow::Value::bound, calculate(), ValueFlow::Value::changeKnownToPossible(), ValueFlow::combineValueProperties(), ValueFlow::Value::conditional, ValueFlow::Value::CONTAINER_SIZE, contains(), Settings::debugnormal, done, Library::Container::EMPTY, Token::eString, findParent(), getCastTypeStartToken(), getContainerYield(), ValueFlow::getSizeOf(), Token::getStrLength(), ValueFlow::Value::indirect, ValueFlow::Value::INT, ValueFlow::Value::intvalue, Token::isArithmeticalOp(), Token::isCast(), ValueFlow::Value::isContainerSizeValue(), ValueFlow::Value::isImpossible(), Token::isInitComma(), ValueFlow::Value::isIntValue(), ValueFlow::isLifetimeBorrowed(), ValueFlow::Value::isLifetimeValue(), Library::isNotLibraryFunction(), ValueFlow::Value::isTokValue(), Token::isUnaryOp(), ValueFlow::Value::isUninitValue(), ValueFlow::Value::Iterator, Settings::library, ValueFlow::Value::lifetimeKind, ValueFlow::Value::Lower, Token::Match(), Token::next(), nonneg, op1_and_op2, Token::originalName(), ValueType::parseDecl(), ValueFlow::Value::path, ValueFlow::Value::Point, Token::previous(), ValueFlow::Value::setKnown(), ValueFlow::Value::setPossible(), setSourceLocation(), setTokenValueCast(), ValueType::sign, ValueType::SIGNED, Token::simpleMatch(), Library::Container::SIZE, Token::str(), ValueFlow::Value::subexpressions, ValueFlow::Value::SYMBOLIC, truncateImplicitConversion(), ValueFlow::Value::Upper, Token::values(), Token::valueType(), ValueFlow::Value::valueType, and visitAstNodes().
Referenced by LifetimeStore::byRef(), LifetimeStore::byVal(), setFunctionReturnValue(), setTokenValueCast(), ValueFlowAnalyzer::update(), valueFlowAfterMove(), valueFlowArray(), valueFlowArrayBool(), valueFlowArrayElement(), valueFlowBitAnd(), valueFlowContainerSize(), valueFlowForLoopSimplify(), valueFlowForwardConst(), valueFlowForwardLifetime(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowIteratorInfer(), valueFlowIterators(), valueFlowLibraryFunction(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowNumber(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSameExpressions(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowString(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), valueFlowUninit(), and valueFlowUnknownFunctionReturn().
|
static |
Set token value for cast.
Definition at line 1090 of file valueflow.cpp.
References castValue(), Platform::char_bit, ValueFlow::Value::FLOAT, ValueFlow::Value::floatValue, Platform::int_bit, ValueFlow::Value::intvalue, ValueType::isFloat(), ValueFlow::Value::isImpossible(), ValueFlow::Value::isIntValue(), isNumeric(), Platform::long_bit, Platform::long_long_bit, Settings::platform, ValueType::pointer, setTokenValue(), Platform::short_bit, ValueType::sign, Platform::signedCharMax(), Platform::signedCharMin(), ValueType::type, and ValueFlow::Value::valueType.
Referenced by setTokenValue().
|
static |
Definition at line 238 of file valueflow.cpp.
References Token::Match(), and setValueUpperBound().
Referenced by setConditionalValues().
|
static |
Definition at line 230 of file valueflow.cpp.
References ValueFlow::Value::bound, ValueFlow::Value::Lower, and ValueFlow::Value::Upper.
Referenced by setValueBound().
Definition at line 3838 of file valueflow.cpp.
References Token::Match(), and Token::next().
Referenced by isNotEqual().
|
static |
Definition at line 8434 of file valueflow.cpp.
References Token::hasKnownIntValue(), and ValueFlow::solveExprValue().
Referenced by makeAnalyzer(), and ProgramMemory::setValue().
|
static |
Definition at line 576 of file valueflow.cpp.
References astIsIntegral(), Token::astOperand1(), Token::astOperand2(), castValue(), ValueFlow::getSizeOf(), ValueFlow::Value::intvalue, Token::isBinaryOp(), Token::isConstOp(), ValueFlow::Value::isFloatValue(), ValueFlow::Value::isIntValue(), sign(), ValueType::sign, and ValueFlow::Value::wideintvalue.
Referenced by setTokenValue().
|
static |
Definition at line 607 of file valueflow.cpp.
Referenced by truncateValues(), and ValueFlowAnalyzer::writeValue().
|
static |
Definition at line 6014 of file valueflow.cpp.
References ValueFlow::Value::bound, ValueFlow::Value::floatValue, ValueFlow::getSizeOf(), ValueFlow::Value::INT, ValueFlow::Value::intvalue, ValueFlow::Value::isFloatValue(), ValueFlow::Value::isImpossible(), ValueType::isIntegral(), ValueFlow::Value::isIntValue(), ValueType::sign, truncateIntValue(), ValueFlow::Value::Upper, and ValueFlow::Value::valueType.
Referenced by valueFlowAfterAssign().
|
static |
Definition at line 6083 of file valueflow.cpp.
References astIsContainer(), astIsLHS(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::CONTAINER_SIZE, ValueFlow::Value::errorPath, Token::exprId(), findAstNode(), SymbolDatabase::functionScopes, getLHSVariables(), intersects(), ValueFlow::Value::intvalue, ValueFlow::Value::isKnown(), Token::isSplittedVarDeclEq(), ValueFlow::Value::isSymbolicValue(), ValueFlow::Value::isUninitValue(), isVariableInit(), Token::next(), nextAfterAstRightmostLeaf(), Token::str(), ValueFlow::Value::tokvalue, truncateValues(), valueFlowForward(), valueFlowForwardAssign(), Token::values(), Token::valueType(), and ValueFlow::Value::valueType.
Referenced by ValueFlow::setValues().
|
static |
Definition at line 5251 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::astParent(), Scope::bodyEnd, Scope::bodyStart, Function::constructorMemberInitialization(), Standards::cpp, Standards::CPP11, ValueFlow::Value::errorPath, Token::expressionString(), findEndOfFunctionCallForParameter(), findOpenParentesisOfMove(), Scope::function, SymbolDatabase::functionScopes, ValueFlow::getEndOfExprScope(), Variable::isArgument(), TokenList::isCPP(), Variable::isLocal(), isOpenParenthesisMemberFunctionCallOfVarId(), isStdMoveOrStdForwarded(), Token::link(), Token::Match(), ValueFlow::Value::MOVED, ValueFlow::Value::MovedVariable, ValueFlow::Value::moveKind, Token::next(), ValueFlow::Value::NonMovedVariable, nonneg, Token::originalName(), Variable::scope(), ValueFlow::Value::setKnown(), setTokenValue(), Token::simpleMatch(), Settings::standards, Token::str(), valueFlowForward(), ValueFlow::Value::valueType, Token::variable(), and Token::varId().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 6220 of file valueflow.cpp.
References astFlatten(), Token::astOperand2(), Scope::bodyEnd, Scope::bodyStart, SymbolDatabase::functionScopes, getVariables(), Token::next(), Token::simpleMatch(), and valueFlowForwardAssign().
Referenced by ValueFlow::setValues().
Definition at line 1508 of file valueflow.cpp.
References astIsRHS(), Token::astParent(), TokenList::front(), Token::link(), Token::Match(), Token::next(), ValueFlow::Value::setKnown(), setTokenValue(), Token::simpleMatch(), ValueFlow::Value::TOK, Token::tokAt(), ValueFlow::Value::tokvalue, ValueFlow::Value::valueType, Token::variable(), and Token::varId().
Referenced by ValueFlow::setValues().
Definition at line 1582 of file valueflow.cpp.
References astIsBool(), Token::astParent(), TokenList::front(), getOtherOperand(), Token::hasKnownIntValue(), Variable::isArgument(), Variable::isArray(), isNonZero(), Variable::isStlType(), ValueFlow::Value::isTokValue(), Token::Match(), Token::next(), ValueFlow::Value::setKnown(), setTokenValue(), Token::values(), and Token::variable().
Referenced by ValueFlow::setValues().
Definition at line 1615 of file valueflow.cpp.
References astIsContainer(), Token::astOperand1(), Token::astOperand2(), Library::Container::AT_INDEX, ValueFlow::Value::condition, ValueFlow::Value::errorPath, Token::eString, TokenList::front(), getArguments(), getLibraryContainer(), Library::Container::getYield(), Token::hasKnownIntValue(), ValueFlow::Value::intvalue, Token::isBinaryOp(), Token::Match(), Token::next(), ValueFlow::Value::setInconclusive(), setTokenValue(), Token::simpleMatch(), Library::Container::stdAssociativeLike, Token::strAt(), Token::tokAt(), ValueFlow::Value::valueKind, Token::values(), ValueFlow::Value::varId, and ValueFlow::Value::varvalue.
Referenced by ValueFlow::setValues().
Definition at line 1723 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), MathLib::bigint_bits, TokenList::front(), Token::hasKnownValue(), MathLib::isInt(), Token::next(), setTokenValue(), Token::str(), and MathLib::toBigNumber().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 6911 of file valueflow.cpp.
Referenced by ValueFlow::setValues().
|
static |
Definition at line 5400 of file valueflow.cpp.
References astIsBool(), Token::astOperand2(), bailoutIncompleteVar, Scope::bodyEnd, Scope::bodyStart, Settings::checkLevel, Settings::daca, debug, Settings::debugwarnings, Token::eLogicalOp, Token::exprId(), findIncompleteVar(), SymbolDatabase::functionScopes, getConditions(), getLoopScope(), TokenList::getSourceFilePath(), Token::hasKnownIntValue(), isBool(), isBreakOrContinueScope(), Token::isComparisonOp(), isConstExpression(), isEscapeScope(), Settings::library, Token::link(), makeConditionValue(), Token::Match(), Token::next(), normal, Settings::normal, ErrorLogger::reportErr(), Token::simpleMatch(), Token::tokType(), and valueFlowGenericForward().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 8826 of file valueflow.cpp.
References astIsContainerString(), Token::astOperand2(), Token::link(), Token::Match(), Token::next(), ValueFlow::Value::setKnown(), Token::simpleMatch(), ValueFlow::Value::TOK, ValueFlow::Value::tokvalue, valueFlowForward(), valueFlowForwardConst(), ValueFlow::Value::valueType, and Token::variable().
Referenced by valueFlowContainerSize().
|
static |
Definition at line 8864 of file valueflow.cpp.
References astIsContainer(), Token::astOperand1(), Token::astOperand2(), Token::astTop(), Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::bound, Library::Container::CLEAR, ValueType::container, ValueFlow::Value::CONTAINER_SIZE, Token::exprId(), SymbolDatabase::functionScopes, Library::Container::getAction(), getArguments(), getContainerSizeFromConstructor(), getFunctionScope(), getInitListSize(), getLibraryContainer(), Token::getStrLength(), Token::hasKnownIntValue(), Token::hasKnownValue(), isIteratorPair(), isVariableChanged(), Dimension::known, Token::link(), Token::linkAt(), Token::Match(), Token::next(), nextAfterAstRightmostLeaf(), nonLocal(), Dimension::num, Token::previous(), Library::Container::PUSH, Library::Container::RESIZE, Token::scope(), ValueFlow::Value::setImpossible(), ValueFlow::Value::setKnown(), setTokenValue(), Token::simpleMatch(), Library::Container::size_templateArgNo, Library::Container::stdStringLike, Token::strAt(), Dimension::tok, ValueFlow::Value::TOK, Token::tokAt(), ValueFlow::Value::tokvalue, ValueFlow::Value::Upper, valueFlowContainerSetTokValue(), valueFlowForward(), valueFlowForwardConst(), valueFlowGetStrLength(), Token::values(), Token::valueType(), ValueFlow::Value::valueType, and SymbolDatabase::variableList().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 9389 of file valueflow.cpp.
References Token::astParent(), debug, Settings::debugnormal, debugString(), Settings::debugwarnings, TokenList::front(), Token::getTokenDebug(), Token::next(), normal, ErrorLogger::reportErr(), ValueFlow, and Token::values().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 9093 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::astParent(), Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::BUFFER_SIZE, Library::AllocFunc::bufferSize, Library::AllocFunc::bufferSizeArg1, Library::AllocFunc::bufferSizeArg2, Library::AllocFunc::calloc, ValueFlow::Value::errorPath, Token::eString, SymbolDatabase::functionScopes, Library::getAllocFuncInfo(), getArguments(), Token::getKnownIntValue(), Library::getReallocFuncInfo(), Token::getStrLength(), Token::hasKnownIntValue(), Token::hasKnownValue(), Token::isCast(), Token::isCpp(), ValueFlow::Value::isTokValue(), Settings::library, Library::AllocFunc::malloc, Token::Match(), Token::next(), Library::AllocFunc::none, Settings::platform, ValueType::pointer, Token::previous(), ValueFlow::Value::setKnown(), Token::str(), Token::strAt(), Library::AllocFunc::strdup, Token::tokAt(), Token::tokType(), ValueFlow::Value::tokvalue, ValueType::typeSize(), valueFlowForward(), Token::values(), Token::valueType(), ValueFlow::Value::valueType, Token::variable(), and Token::varId().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 2044 of file valueflow.cpp.
References Token::astOperand2(), Scope::eEnum, Scope::enumeratorList, Token::hasKnownIntValue(), Token::previous(), SymbolDatabase::scopeList, Enumerator::start, Scope::type, Enumerator::value, Enumerator::value_known, ValueFlow::valueFlowConstantFoldAST(), and Token::values().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 7339 of file valueflow.cpp.
References Analyzer::Result::action, ValueFlow::asImpossible(), Token::astOperand2(), Scope::bodyStart, Scope::classDef, Scope::eFor, extractForLoopValues(), Token::findmatch(), Analyzer::Action::isModified(), ValueFlow::Value::Lower, Token::next(), nonneg, SymbolDatabase::scopeList, Token::simpleMatch(), Scope::type, ValueFlow::Value::Upper, valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForLoopSimplifyAfter(), and valueFlowForward().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 7149 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), done, error, execute(), ProgramMemory::hasValue(), Token::next(), op1_and_op2, Token::str(), ProgramMemory::swap(), and visitAstNodes().
Referenced by valueFlowForLoop().
|
static |
Definition at line 7206 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::astParent(), Token::astTop(), bailout, conditionIsFalse(), conditionIsTrue(), Settings::debugwarnings, Token::findmatch(), getProgramMemory(), isVariableChanged(), Token::link(), Token::linkAt(), Token::Match(), Token::next(), nextAfterAstRightmostLeaf(), Token::previous(), setTokenValue(), Token::simpleMatch(), Token::str(), Token::varId(), and ValueFlow::Value::varId.
Referenced by valueFlowForLoop().
|
static |
Definition at line 7311 of file valueflow.cpp.
References Scope::bodyEnd, ValueFlow::Value::errorPath, Variable::isLocal(), Token::linkAt(), Variable::name(), Token::next(), Variable::scope(), Token::scope(), valueFlowForward(), Token::variable(), and Token::varId().
Referenced by valueFlowForLoop().
|
static |
Definition at line 2175 of file valueflow.cpp.
References Analyzer::Result::update(), and valueFlowForward().
|
static |
Definition at line 2156 of file valueflow.cpp.
References Settings::debugnormal, makeAnalyzer(), setSourceLocation(), and valueFlowGenericForward().
Referenced by ConditionHandler::forward(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowForLoop(), valueFlowForLoopSimplifyAfter(), valueFlowForward(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowInjectParameter(), valueFlowSafeFunctions(), valueFlowSymbolic(), and valueFlowUninit().
|
static |
Definition at line 2192 of file valueflow.cpp.
References Scope::bodyEnd, Function::functionScope, Scope::nestedInFunction(), Token::scope(), and valueFlowForward().
|
static |
Definition at line 5892 of file valueflow.cpp.
References Token::astParent(), ValueFlow::Value::bound, ValueFlow::Value::errorPath, findVarBound(), ValueFlow::getEndOfExprScope(), ValueFlow::Value::Impossible, ValueFlow::Value::infoString(), ValueFlow::Value::intvalue, ValueFlow::Value::invertRange(), TokenList::isCPP(), ValueFlow::Value::isImpossible(), isInitialVarAssign(), ValueFlow::Value::isIntValue(), ValueFlow::Value::isLifetimeValue(), ValueFlow::Value::isSymbolicValue(), ValueFlow::Value::isTokValue(), ValueFlow::Value::Lower, lowerToPossible(), Token::Match(), Token::next(), nextAfterAstRightmostLeaf(), ValueFlow::Value::Point, ValueFlow::Value::setImpossible(), Token::simpleMatch(), ValueFlow::Value::tokvalue, ValueFlow::Value::Upper, valueFlowForward(), valueFlowForwardConst(), valueFlowForwardLifetime(), ValueFlow::Value::valueKind, and Token::variable().
Referenced by valueFlowAfterAssign(), valueFlowAfterSwap(), valueFlowForwardAssign(), and valueFlowSmartPointer().
|
static |
Definition at line 6002 of file valueflow.cpp.
References Variable::nameToken(), and valueFlowForwardAssign().
|
static |
Definition at line 5786 of file valueflow.cpp.
References ValueFlow::Value::bound, Variable::declarationId(), ValueFlow::Value::errorPath, followAllReferences(), ValueFlow::Value::intvalue, ValueFlow::Value::isImpossible(), ValueFlow::Value::isIntValue(), Variable::nameToken(), Token::next(), precedes(), ValueFlow::Value::setInconclusive(), setTokenValue(), ValueFlow::Value::valueKind, Token::values(), and Token::varId().
Referenced by valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowForwardAssign(), and valueFlowForwardConst().
|
static |
Definition at line 5843 of file valueflow.cpp.
References valueFlowForwardConst().
|
static |
Definition at line 4013 of file valueflow.cpp.
References ValueFlow::Value::Address, Token::astOperand1(), Token::astOperand2(), Token::astParent(), Scope::bodyEnd, Token::exprId(), findAstNode(), ValueFlow::getEndOfExprScope(), getLHSVariableToken(), getParentLifetime(), Token::isCast(), ValueFlow::isLifetimeBorrowed(), isNotLifetimeValue(), isScopeBracket(), isVariableDecl(), Settings::library, ValueFlow::Value::lifetimeKind, Token::Match(), Token::next(), nextAfterAstRightmostLeaf(), Token::previous(), Variable::scope(), setTokenValue(), Token::simpleMatch(), Token::str(), ValueFlow::Value::SubObject, ValueFlow::Value::tokvalue, valueFlowForward(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), Token::values(), and Token::variable().
Referenced by LifetimeStore::forEach(), LifetimeStore::forwardLifetime(), valueFlowForwardAssign(), valueFlowLifetime(), and valueFlowLifetimeFunction().
|
static |
Definition at line 2207 of file valueflow.cpp.
References Settings::debugnormal, makeAnalyzer(), setSourceLocation(), and valueFlowGenericForward().
Referenced by ConditionHandler::forward().
|
static |
Definition at line 7879 of file valueflow.cpp.
References ValueFlow::Value::changeKnownToPossible(), ValueFlow::Value::defaultArg, Scope::function, SymbolDatabase::functionScopes, Variable::hasDefault(), TokenList::isCPP(), ValueFlow::Value::isPossible(), Token::Match(), Variable::nameToken(), Token::tokAt(), valueFlowInjectParameter(), and Token::values().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 7948 of file valueflow.cpp.
References Token::astOperand1(), TokenList::back(), bailout, ProgramMemory::clear(), Settings::debugwarnings, ProgramMemory::empty(), execute(), Function::findReturns(), Token::function(), getArguments(), getKnownValueFromToken(), getKnownValueFromTokens(), Token::hasKnownValue(), Token::isCast(), Token::Match(), Variable::nameToken(), Token::previous(), setFunctionReturnValue(), ProgramMemory::setValue(), and Token::str().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 8849 of file valueflow.cpp.
References astIsGenericChar(), ValueFlow::Value::CONTAINER_SIZE, Token::eChar, Token::eString, Token::getKnownValue(), Token::getStrLength(), ValueFlow::Value::TOK, and Token::tokType().
Referenced by valueFlowContainerSize().
Definition at line 2071 of file valueflow.cpp.
References Token::astOperand2(), ValueType::constness, TokenList::front(), ValueType::isIntegral(), Token::Match(), Token::next(), ValueType::pointer, setTokenValue(), Token::valueType(), and Token::variable().
Referenced by ValueFlow::setValues().
Definition at line 2105 of file valueflow.cpp.
References Token::astOperand2(), Token::astParent(), ValueType::constness, TokenList::front(), Token::isCpp(), ValueType::isIntegral(), isLikelyStreamRead(), Token::Match(), Token::next(), ValueType::pointer, setTokenValue(), Token::valueType(), and Token::variable().
Referenced by ValueFlow::setValues().
Definition at line 1937 of file valueflow.cpp.
References astIsBool(), astIsContainerOwned(), astIsPointer(), astIsUnsigned(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), ValueFlow::Value::bound, TokenList::front(), getLibraryContainer(), Token::hasKnownIntValue(), ValueFlow::Value::intvalue, isConvertedToIntegral(), TokenList::isCPP(), Token::isIncompleteVar(), isSameToken(), Token::isUnaryOp(), Token::linkAt(), ValueFlow::Value::Lower, makeArray(), Token::Match(), minUnsignedValue(), Token::next(), ValueFlow::Value::setImpossible(), setTokenValue(), Token::simpleMatch(), Library::Container::stdStringLike, ValueFlow::Value::SYMBOLIC, Token::tokAt(), ValueFlow::Value::Upper, Token::values(), ValueFlow::Value::valueType, and Library::Container::view.
Referenced by ValueFlow::setValues().
Definition at line 7045 of file valueflow.cpp.
References astIsIterator(), astIsPointer(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), TokenList::front(), Token::hasKnownIntValue(), infer(), ValueFlow::Value::INT, isIntegralOrPointer(), isUsedAsBool(), Token::Match(), Token::next(), setTokenValue(), Token::str(), Token::values(), and ValueFlow::Value::valueType.
Referenced by ValueFlow::setValues().
|
static |
Definition at line 7637 of file valueflow.cpp.
References Scope::bodyEnd, Scope::bodyStart, Variable::declarationId(), Variable::isClass(), Variable::isConst(), Variable::isReference(), Variable::nameToken(), Token::next(), nonneg, and valueFlowForward().
|
static |
Definition at line 7618 of file valueflow.cpp.
References bailout, Scope::bodyEnd, Scope::bodyStart, Settings::debugwarnings, Scope::function, productParams(), and valueFlowGenericForward().
Referenced by valueFlowFunctionDefaultParameter(), and valueFlowSubFunction().
|
static |
Definition at line 8771 of file valueflow.cpp.
References ValueType::containerTypeToken, ValueType::isTypeEqual(), ValueType::parseDecl(), ValueType::type, and Token::valueType().
Referenced by getInitListSize().
Definition at line 8665 of file valueflow.cpp.
References ValueFlow::Value::bound, ValueFlow::Value::condition, TokenList::front(), getIteratorValues(), ValueFlow::Value::intvalue, ValueFlow::Value::isImpossible(), ValueFlow::Value::isIteratorEndValue(), ValueFlow::Value::isIteratorStartValue(), Token::next(), ValueFlow::Value::Point, Token::scope(), ValueFlow::Value::setPossible(), setTokenValue(), and Token::values().
Referenced by ValueFlow::setValues().
Definition at line 8601 of file valueflow.cpp.
References astIsContainer(), Library::Container::END_ITERATOR, findIteratorYield(), TokenList::front(), ValueFlow::Value::ITERATOR_END, ValueFlow::Value::ITERATOR_START, Token::next(), Token::scope(), ValueFlow::Value::setKnown(), setTokenValue(), Library::Container::START_ITERATOR, and ValueFlow::Value::valueType.
Referenced by ValueFlow::setValues().
|
static |
Definition at line 7745 of file valueflow.cpp.
References evaluateLibraryFunction(), getArguments(), getFunctionArgumentValues(), Token::isCpp(), ValueFlow::Value::isImpossible(), ValueFlow::Value::isUninitValue(), ValueFlow::Value::Known, Token::previous(), productParams(), setTokenValue(), and ValueFlow::Value::valueKind.
Referenced by valueFlowSubFunction().
|
static |
Definition at line 4918 of file valueflow.cpp.
References ValueFlow::Value::Address, astFunctionYield(), astIsContainer(), astIsContainerOwned(), astIsContainerView(), astIsIterator(), astIsLHS(), astIsPointer(), astIsUniqueSmartPointer(), Token::astOperand1(), Token::astParent(), astParentSkipParens(), Lambda::bodyTok, LifetimeStore::byRef(), ByReference, ByValue, Settings::certainty, ValueType::containerTypeToken, contains(), Variable::declarationId(), Scope::eGlobal, Library::Container::END_ITERATOR, ValueFlow::Value::errorPath, Lambda::explicitCaptures, exprDependsOnThis(), followAllReferences(), TokenList::front(), ValueFlow::getLifetimeTokens(), ValueFlow::getLifetimeVariable(), Lambda::implicitCapture, inconclusive, Variable::isArgument(), Variable::isArray(), isContainerOfPointers(), isConvertedToView(), isDecayedPointer(), SimpleEnableGroup< T >::isEnabled(), Lambda::isLambda(), ValueFlow::Value::isLifetimeValue(), Variable::isLocal(), Scope::isNestedIn(), isScope(), Variable::isStlType(), Token::isUnaryOp(), ValueFlow::Value::Iterator, ValueFlow::Value::Lambda, ValueFlow::Value::LIFETIME, ValueFlow::Value::lifetimeKind, ValueFlow::Value::lifetimeScope, Token::link(), ValueFlow::Value::Local, Token::Match(), Variable::nameToken(), Token::next(), ValueFlow::Value::Object, Token::originalName(), Token::previous(), Variable::scope(), Token::scope(), ValueFlow::Value::setInconclusive(), setTokenValue(), Token::simpleMatch(), Library::Container::START_ITERATOR, ValueFlow::Value::SubObject, ValueFlow::Value::ThisPointer, ValueFlow::Value::ThisValue, Token::tokAt(), ValueFlow::Value::tokvalue, valueFlowForwardLifetime(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), Token::values(), Token::valueType(), ValueFlow::Value::valueType, Token::variable(), and Token::varId().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 4696 of file valueflow.cpp.
References LifetimeStore::argtok, LifetimeStore::byRef(), LifetimeStore::byVal(), Type::classScope, Type::derivedFrom, findConstructor(), LifetimeStore::forEach(), getArguments(), LifetimeStore::inconclusive, Type::isClassType(), ValueFlow::isLifetimeBorrowed(), Variable::isReference(), Variable::isRValueReference(), isScope(), Type::isStructType(), isVariableDecl(), Token::Match(), Type::name(), Scope::numConstructors, Token::previous(), ValueType::RECORD, Token::str(), ValueFlow::Value::SubObject, ValueType::type, valueFlowLifetimeUserConstructor(), Token::valueType(), and Scope::varlist.
Referenced by valueFlowLifetimeConstructor().
|
static |
Definition at line 4763 of file valueflow.cpp.
References astIsContainerOwned(), astIsIterator(), LifetimeStore::byDerefCopy(), LifetimeStore::byVal(), ValueType::CONTAINER, LifetimeStore::forEach(), getArguments(), getParentValueTypes(), isScope(), isVariableDecl(), Token::Match(), Token::previous(), Token::simpleMatch(), ValueFlow::Value::SubObject, Token::typeOf(), valueFlowLifetimeClassConstructor(), and Token::valueType().
Referenced by valueFlowForwardLifetime(), valueFlowLifetime(), and valueFlowLifetimeFunction().
|
static |
Definition at line 4507 of file valueflow.cpp.
References ValueFlow::Value::Address, LifetimeStore::argtok, astIsIterator(), astIsNonStringContainer(), astIsPointer(), astIsRHS(), Token::astParent(), LifetimeStore::byDerefCopy(), LifetimeStore::byRef(), LifetimeStore::byVal(), Library::ArgumentChecks::IteratorInfo::container, contains(), derefShared(), LifetimeStore::errorPath, ValueFlow::Value::errorPath, exprDependsOnThis(), Token::expressionString(), Function::findReturns(), LifetimeStore::forward, LifetimeStore::fromFunctionArg(), Token::function(), Library::getArgIteratorInfo(), getArguments(), Library::getFunction(), ValueFlow::getLifetimeVariable(), inconclusive, LifetimeStore::inconclusive, Variable::isArgument(), Variable::isConst(), Function::isConstructor(), ValueFlow::isLifetimeBorrowed(), ValueFlow::Value::isLifetimeValue(), Variable::isReference(), Variable::isRValueReference(), isVariableChanged(), Settings::library, lifetimeType(), Token::Match(), Token::next(), ValueFlow::Value::Object, Token::previous(), Function::returnsReference(), Library::returnValue(), Library::returnValueContainer(), setTokenValue(), startsWith(), Token::str(), ValueFlow::Value::ThisPointer, ValueFlow::Value::ThisValue, Token::tokAt(), Token::typeStr(), valueFlowForwardLifetime(), valueFlowLifetimeConstructor(), valueFlowLifetimeUserConstructor(), Token::values(), Token::valueType(), and Token::variable().
Referenced by valueFlowForwardLifetime(), and valueFlowLifetime().
|
static |
Definition at line 4413 of file valueflow.cpp.
References LifetimeStore::argtok, astFlatten(), Token::astOperand1(), Token::astOperand2(), LifetimeStore::byRef(), ByReference, LifetimeStore::byVal(), ByValue, Function::constructorMemberInitialization(), LifetimeStore::forEach(), Function::getArgumentVar(), ValueFlow::getLifetimeVariable(), hasBorrowingVariables(), LifetimeStore::inconclusive, Variable::isArgument(), Variable::isConst(), ValueFlow::isLifetimeBorrowed(), Variable::isReference(), Variable::isRValueReference(), Function::nestedIn, Token::simpleMatch(), ValueFlow::Value::SubObject, Undefined, Token::values(), and Scope::varlist.
Referenced by valueFlowLifetimeClassConstructor(), and valueFlowLifetimeFunction().
Definition at line 1470 of file valueflow.cpp.
References TokenList::front(), TokenList::isCPP(), Token::isName(), Token::isTemplateArg(), Token::Match(), Token::next(), ValueFlow::Value::setKnown(), setTokenValue(), Token::str(), valueFlowSetConstantValue(), and Token::varId().
Referenced by ValueFlow::setValues().
Definition at line 1692 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::astParent(), TokenList::front(), Token::isUnaryOp(), Token::next(), setTokenValue(), Token::simpleMatch(), Token::str(), ValueFlow::Value::TOK, ValueFlow::Value::tokvalue, ValueFlow::Value::valueType, and Token::variable().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 2242 of file valueflow.cpp.
References valueFlowReverse().
|
static |
Definition at line 2225 of file valueflow.cpp.
References Settings::debugnormal, makeReverseAnalyzer(), setSourceLocation(), and valueFlowGenericReverse().
Referenced by ConditionHandler::reverse(), valueFlowReverse(), and valueFlowSwitchVariable().
Definition at line 1842 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), MathLib::bigint_bits, TokenList::front(), getExpressionRange(), Token::hasKnownValue(), Platform::int_bit, Platform::long_bit, Platform::long_long_bit, Token::next(), Settings::platform, ValueFlow::Value::setKnown(), setTokenValue(), and Token::str().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 9262 of file valueflow.cpp.
References Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::CONTAINER_SIZE, ValueFlow::Value::FLOAT, Scope::function, SymbolDatabase::functionScopes, Token::getCppcheckAttribute(), getMinMaxValues(), Function::isSafe(), Variable::name(), Variable::nameToken(), Token::next(), Settings::platform, MathLib::toString(), Platform::type, ValueType::type, valueFlowForward(), and Variable::valueType().
Referenced by ValueFlow::setValues().
Definition at line 1754 of file valueflow.cpp.
References astIsIntegral(), Token::astOperand1(), Token::astOperand2(), ValueFlow::Value::errorPath, TokenList::front(), Token::hasKnownIntValue(), ValueFlow::Value::isKnown(), isSameExpression(), Token::Match(), Token::next(), ValueFlow::Value::setKnown(), and setTokenValue().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 6248 of file valueflow.cpp.
References changePossibleToKnown(), isConditionKnown(), and Token::Match().
Referenced by ConditionHandler::afterCondition().
Definition at line 1256 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::astParent(), Type::classScope, Standards::cpp, Standards::CPP20, Variable::dimension(), Variable::dimensionKnown(), Variable::dimensions(), Token::eChar, Token::enumerator(), Scope::enumType, Token::eString, ValueFlow::Value::FLOAT, ValueFlow::Value::floatValue, getMinMaxValues(), ValueFlow::getSizeOf(), getSizeOfType(), Token::getStrSize(), Token::isCChar(), Token::isCMultiChar(), Token::isCpp(), Variable::isEnumType(), MathLib::isFloat(), MathLib::isInt(), ValueType::isIntegral(), Token::isLong(), Token::isNumber(), Token::isStandardType(), Token::isTemplateArg(), Token::isUtf16(), Token::isUtf32(), Token::isUtf8(), Token::linkAt(), Token::Match(), Token::next(), nonneg, ValueType::parseDecl(), Settings::platform, ValueType::pointer, Enumerator::scope, ValueFlow::Value::setKnown(), setTokenValue(), ValueType::sign, Token::simpleMatch(), Platform::sizeof_int, Platform::sizeof_wchar_t, Settings::standards, Token::str(), MathLib::toBigNumber(), MathLib::toBigUNumber(), MathLib::toDoubleNumber(), Token::tokAt(), Token::tokType(), Platform::type, Variable::type(), Token::type(), Variable::typeEndToken(), Variable::typeStartToken(), ValueType::UNSIGNED, Enumerator::value, Enumerator::value_known, Variable::valueType(), Token::valueType(), ValueFlow::Value::valueType, Token::variable(), and Token::varId().
Referenced by ValueFlow::valueFlowConstantFoldAST(), and valueFlowNumber().
|
static |
Definition at line 8513 of file valueflow.cpp.
References astIsLHS(), astIsSmartPointer(), Token::astOperand1(), Token::astOperand2(), Token::astParent(), Token::exprId(), TokenList::front(), getArguments(), getVariables(), ValueFlow::Value::isIntValue(), Token::isNumber(), Variable::isSmartPointer(), makeSymbolic(), Token::Match(), Variable::nameToken(), Token::next(), Token::previous(), Token::removeValues(), Token::scope(), ValueFlow::Value::setKnown(), setTokenValue(), Token::simpleMatch(), Token::tokAt(), valueFlowForwardAssign(), Token::values(), and Token::variable().
Referenced by ValueFlow::setValues().
Definition at line 1495 of file valueflow.cpp.
References Token::eString, TokenList::front(), Token::next(), ValueFlow::Value::setKnown(), setTokenValue(), ValueFlow::Value::TOK, Token::tokType(), ValueFlow::Value::tokvalue, and ValueFlow::Value::valueType.
Referenced by ValueFlow::setValues().
|
static |
Definition at line 7797 of file valueflow.cpp.
References Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::errorPath, Token::expressionString(), Scope::function, Token::function(), Function::functionScope, SymbolDatabase::functionScopes, getArguments(), Function::getArgumentVar(), getFunctionArgumentValues(), getOrdinalText(), ValueFlow::Value::infoString(), Token::isKeyword(), ValueFlow::Value::isLifetimeValue(), ValueFlow::Value::isLocalLifetimeValue(), ValueFlow::Value::isSubFunctionLifetimeValue(), CheckUninitVar::isVariableUsage(), Settings::library, ValueFlow::Value::lifetimeScope, lowerToPossible(), MakeIteratorRange(), Token::Match(), Function::name(), Token::next(), ValueFlow::Value::path, Library::returnValue(), ValueFlow::Value::SubFunction, valueFlowInjectParameter(), valueFlowLibraryFunction(), and Token::variable().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 7662 of file valueflow.cpp.
References bailout, Scope::bodyEnd, Scope::bodyStart, Scope::classDef, Settings::debugwarnings, Variable::isArgument(), Variable::isConst(), Variable::isLocal(), Token::isName(), Token::link(), Token::Match(), Variable::name(), Token::next(), Token::previous(), SymbolDatabase::scopeList, Token::simpleMatch(), Token::str(), MathLib::toBigNumber(), Token::tokAt(), Scope::type, valueFlowReverse(), and Token::variable().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 5541 of file valueflow.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::astParent(), Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::errorPath, findAstNode(), SymbolDatabase::functionScopes, ValueFlow::getEndOfExprScope(), getLHSVariables(), getVarIds(), isConstExpression(), isDifferentType(), Token::isIncompleteVar(), isTruncated(), Settings::library, makeSymbolic(), Token::next(), nextAfterAstRightmostLeaf(), Token::simpleMatch(), and valueFlowForward().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 5747 of file valueflow.cpp.
References astIsFloat(), Token::astOperand1(), Token::astOperand2(), Scope::bodyEnd, Scope::bodyStart, SymbolDatabase::functionScopes, Token::hasKnownIntValue(), infer(), Token::Match(), Token::next(), setTokenValue(), and Token::str().
Referenced by ValueFlow::setValues().
|
static |
Definition at line 5634 of file valueflow.cpp.
References astIsIntegral(), astIsLHS(), Token::astOperand1(), Token::astOperand2(), Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::bound, ValueFlow::Value::errorPath, Token::exprId(), SymbolDatabase::functionScopes, Token::hasKnownIntValue(), inferCondition(), ValueFlow::Value::INT, ValueFlow::Value::intvalue, ValueFlow::Value::isKnown(), isStrlenOf(), ValueFlow::Value::isSymbolicValue(), makeSymbolic(), Token::Match(), Token::next(), ValueFlow::Value::Point, ValueFlow::Value::setImpossible(), ValueFlow::Value::setKnown(), setTokenValue(), Token::simpleMatch(), Token::str(), ValueFlow::Value::tokvalue, Token::values(), and ValueFlow::Value::valueType.
Referenced by ValueFlow::setValues().
|
static |
Definition at line 8116 of file valueflow.cpp.
References addToErrorPath(), Scope::bodyEnd, Scope::bodyStart, Variable::dimensions(), Token::findsimplematch(), findStartToken(), TokenList::front(), ValueFlow::Value::indirect, Variable::isArray(), Variable::isExtern(), Variable::isInit(), Variable::isLocal(), Variable::isPointer(), Variable::isPublic(), Variable::isReference(), Variable::isStatic(), Variable::isThrow(), Settings::library, Token::Match(), Variable::nameToken(), needsInitialization(), Token::next(), SubExpressionAnalyzer::partialReads, Token::scope(), ValueFlow::Value::setKnown(), setTokenValue(), Token::str(), ValueFlow::Value::subexpressions, ValueFlow::Value::tokvalue, Variable::typeScope(), ValueFlow::Value::UNINIT, valueFlowForward(), valueFlowGenericForward(), ValueFlow::Value::valueType, Token::variable(), and Scope::varlist.
Referenced by ValueFlow::setValues().
|
static |
Definition at line 9360 of file valueflow.cpp.
References Token::astOperand1(), Token::astParent(), Settings::checkUnknownFunctionReturn, TokenList::front(), getMinMaxValues(), Token::isCpp(), Token::isName(), Settings::library, Token::next(), Token::previous(), Library::returnValueType(), setTokenValue(), Token::str(), and Library::unknownReturnValues().
Referenced by ValueFlow::setValues().