summaryrefslogtreecommitdiff
path: root/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
authorGuy Benyei <guy.benyei@intel.com>2013-02-12 21:21:59 +0000
committerGuy Benyei <guy.benyei@intel.com>2013-02-12 21:21:59 +0000
commit87d0b9ed1462705dd9bf1cb7f67d0bf03af776c8 (patch)
tree54c1b122b1f937a363b1ce4a1e091e795d575785 /lib/Support/raw_ostream.cpp
parent5f3c4a39109479e81238ce28e91e5dcc565f068c (diff)
downloadllvm-87d0b9ed1462705dd9bf1cb7f67d0bf03af776c8.tar.gz
llvm-87d0b9ed1462705dd9bf1cb7f67d0bf03af776c8.tar.bz2
llvm-87d0b9ed1462705dd9bf1cb7f67d0bf03af776c8.tar.xz
Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/raw_ostream.cpp')
-rw-r--r--lib/Support/raw_ostream.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index 106864dd05..f71abd3b24 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -241,7 +241,8 @@ raw_ostream &raw_ostream::operator<<(double N) {
if (cs == '+' || cs == '-') {
int c1 = buf[len - 2];
int c0 = buf[len - 1];
- if (isdigit(c1) && isdigit(c0)) {
+ if (isdigit(static_cast<unsigned char>(c1)) &&
+ isdigit(static_cast<unsigned char>(c0))) {
// Trim leading '0': "...e+012" -> "...e+12\0"
buf[len - 3] = c1;
buf[len - 2] = c0;