aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorBalázs Kéri <balazs.keri@ericsson.com>2024-09-26 09:49:29 +0200
committerGitHub <noreply@github.com>2024-09-26 09:49:29 +0200
commitae54a00cc1eb64a0300e190ccdc46ae9b31d2835 (patch)
tree20f813779e78ff20feb4be76f488ed729ee5f4e3 /clang/lib
parentf3111cc77bea8d4f6b3ca90ee5457cff5faeb3fc (diff)
downloadllvm-ae54a00cc1eb64a0300e190ccdc46ae9b31d2835.zip
llvm-ae54a00cc1eb64a0300e190ccdc46ae9b31d2835.tar.gz
llvm-ae54a00cc1eb64a0300e190ccdc46ae9b31d2835.tar.bz2
[clang][analyzer] FixedAddressChecker: no warning if system macro is used (#108993)
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
index 7aefcdc..e7fde3e 100644
--- a/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
@@ -48,6 +48,9 @@ void FixedAddressChecker::checkPreStmt(const BinaryOperator *B,
if (!RV.isConstant() || RV.isZeroConstant())
return;
+ if (C.getSourceManager().isInSystemMacro(B->getRHS()->getBeginLoc()))
+ return;
+
if (ExplodedNode *N = C.generateNonFatalErrorNode()) {
// FIXME: improve grammar in the following strings:
constexpr llvm::StringLiteral Msg =