aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/LiteralSupport.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-27 17:00:18 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-27 17:00:18 +0000
commit17c8c84fbc5cbde336fdef8fffe63c08a955ade9 (patch)
treee29df19b73c24b682fd2dc139ed22f0041b07f18 /lib/Lex/LiteralSupport.cpp
parentc737acb8e86564becc5939d681089d1851e6be1a (diff)
When parsing a character literal, extract the characters from the
buffer as an 'unsigned char', so that integer promotion doesn't sign-extend character values > 127 into oblivion. Fixes <rdar://problem/10188919>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/LiteralSupport.cpp')
-rw-r--r--lib/Lex/LiteralSupport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp
index ef385a8aed..96550e6492 100644
--- a/lib/Lex/LiteralSupport.cpp
+++ b/lib/Lex/LiteralSupport.cpp
@@ -784,7 +784,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
// Is this a Universal Character Name escape?
if (begin[0] != '\\') // If this is a normal character, consume it.
- ResultChar = *begin++;
+ ResultChar = (unsigned char)*begin++;
else { // Otherwise, this is an escape character.
unsigned CharWidth = getCharWidth(Kind, PP.getTargetInfo());
// Check for UCN.