diff options
author | Jordy Rose <jediknil@belkadan.com> | 2011-06-20 03:51:53 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2011-06-20 03:51:53 +0000 |
commit | 8cc2491239f0b9de35985a1650fffc05c1ca8242 (patch) | |
tree | a67d09dad27e859ac2411044c8e611945d776915 /lib/StaticAnalyzer/Checkers/CStringChecker.cpp | |
parent | 5e5f15062bcf4b62fda9062b453178f8b9bd0c2d (diff) |
[analyzer] Replace stream-built error message with constant string. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/CStringChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index 82f2855d17..22bfad0f75 100644 --- a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -535,16 +535,15 @@ const GRState *CStringChecker::checkAdditionOverflow(CheckerContext &C, BT_AdditionOverflow.reset(new BuiltinBug("API", "Sum of expressions causes overflow")); - llvm::SmallString<120> buf; - llvm::raw_svector_ostream os(buf); // This isn't a great error message, but this should never occur in real // code anyway -- you'd have to create a buffer longer than a size_t can // represent, which is sort of a contradiction. - os << "This expression will create a string whose length is too big to " - << "be represented as a size_t"; + const char *warning = + "This expression will create a string whose length is too big to " + "be represented as a size_t"; // Generate a report for this bug. - BugReport *report = new BugReport(*BT_AdditionOverflow, os.str(), N); + BugReport *report = new BugReport(*BT_AdditionOverflow, warning, N); C.EmitReport(report); return NULL; |