[cfe-commits] r133410 - /cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
Jordy Rose
jediknil at belkadan.com
Sun Jun 19 20:51:54 PDT 2011
Author: jrose
Date: Sun Jun 19 22:51:53 2011
New Revision: 133410
URL: http://llvm.org/viewvc/llvm-project?rev=133410&view=rev
Log:
[analyzer] Replace stream-built error message with constant string. No functionality change.
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp?rev=133410&r1=133409&r2=133410&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp Sun Jun 19 22:51:53 2011
@@ -535,16 +535,15 @@
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;
More information about the cfe-commits
mailing list