diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -2153,7 +2153,8 @@ } }; -class DefaultExpressionHandler final : public ExpressionHandler { +// TODO: extract it into more handlers +class InterestingLValueHandler final : public ExpressionHandler { public: using ExpressionHandler::ExpressionHandler; @@ -2225,11 +2226,25 @@ if (auto KV = V.getAs()) getParentTracker().track(*KV, R, Opts, SFC); - - return Result; } } + return Result; + } +}; + +class DefaultExpressionHandler final : public ExpressionHandler { +public: + using ExpressionHandler::ExpressionHandler; + + Tracker::Result handle(const Expr *Inner, const ExplodedNode *InputNode, + const ExplodedNode *LVNode, + TrackingOptions Opts) override { + ProgramStateRef LVState = LVNode->getState(); + const StackFrameContext *SFC = LVNode->getStackFrame(); + PathSensitiveBugReport &Report = getParentTracker().getReport(); + Tracker::Result Result; + // If the expression is not an "lvalue expression", we can still // track the constraints on its contents. SVal V = LVState->getSValAsScalarOrLoc(Inner, LVNode->getLocationContext()); @@ -2336,6 +2351,7 @@ addLowPriorityHandler(); addLowPriorityHandler(); addLowPriorityHandler(); + addLowPriorityHandler(); addLowPriorityHandler(); addLowPriorityHandler(); // Default store handlers.