diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-09-27 17:00:18 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-09-27 17:00:18 +0000 |
| commit | 4d68366b2f280242401f5184dc4fc35ca32ae819 (patch) | |
| tree | a7f81986501898c9f03eb62d217f98315555ee5e /clang/lib/Lex | |
| parent | ff5d0965b0a89a6ccbe952b64b1e27ab128e6d93 (diff) | |
| download | bcm5719-llvm-4d68366b2f280242401f5184dc4fc35ca32ae819.tar.gz bcm5719-llvm-4d68366b2f280242401f5184dc4fc35ca32ae819.zip | |
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>.
llvm-svn: 140608
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index ef385a8aedb..96550e6492b 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/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. |

