aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
diff options
context:
space:
mode:
authorEndre Fülöp <endre.fulop@sigmatechnology.com>2025-08-08 19:16:47 +0200
committerGitHub <noreply@github.com>2025-08-08 19:16:47 +0200
commit4f2ed926dbbb43f8bd773e64c5e572e5d4103e06 (patch)
tree1894a59b738b419e0ca91531d1a6d999586bcee8 /clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
parent3a4b351ba18492b990b10fe5401c3bbaabcf2f94 (diff)
downloadllvm-4f2ed926dbbb43f8bd773e64c5e572e5d4103e06.zip
llvm-4f2ed926dbbb43f8bd773e64c5e572e5d4103e06.tar.gz
llvm-4f2ed926dbbb43f8bd773e64c5e572e5d4103e06.tar.bz2
[analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (#152137)
Binding a value to location can happen when a new value is created or when and existing value is updated. This modification exposes whether the value binding happens at a declaration. This helps simplify the hacky logic of the BindToImmutable checker.
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
index e98de33..7f8923c 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
@@ -26,13 +26,13 @@ class UndefinedAssignmentChecker
const BugType BT{this, "Assigned value is uninitialized"};
public:
- void checkBind(SVal location, SVal val, const Stmt *S,
+ void checkBind(SVal location, SVal val, const Stmt *S, bool AtDeclInit,
CheckerContext &C) const;
};
}
void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
- const Stmt *StoreE,
+ const Stmt *StoreE, bool AtDeclInit,
CheckerContext &C) const {
if (!val.isUndef())
return;