aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
index 6275e49e51ae..2ee201b64008 100644
--- a/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
@@ -24,7 +24,7 @@ using namespace ento;
namespace {
class FixedAddressChecker
: public Checker< check::PreStmt<BinaryOperator> > {
- mutable std::unique_ptr<BuiltinBug> BT;
+ mutable std::unique_ptr<BugType> BT;
public:
void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
@@ -49,14 +49,13 @@ void FixedAddressChecker::checkPreStmt(const BinaryOperator *B,
return;
if (ExplodedNode *N = C.generateNonFatalErrorNode()) {
+ // FIXME: improve grammar in the following strings:
if (!BT)
- BT.reset(
- new BuiltinBug(this, "Use fixed address",
- "Using a fixed address is not portable because that "
- "address will probably not be valid in all "
- "environments or platforms."));
- auto R =
- std::make_unique<PathSensitiveBugReport>(*BT, BT->getDescription(), N);
+ BT.reset(new BugType(this, "Use fixed address"));
+ constexpr llvm::StringLiteral Msg =
+ "Using a fixed address is not portable because that address will "
+ "probably not be valid in all environments or platforms.";
+ auto R = std::make_unique<PathSensitiveBugReport>(*BT, Msg, N);
R->addRange(B->getRHS()->getSourceRange());
C.emitReport(std::move(R));
}