summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/LiteralSupport.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-11-14 05:17:37 +0000
committerNico Weber <nicolasweber@gmx.de>2011-11-14 05:17:37 +0000
commitd60b72f6964fe65f36b1bf15f47adc84d0091ec6 (patch)
tree3a4e7cc8dda117d5f44b3a2bcc4cae7eb5fa2013 /clang/lib/Lex/LiteralSupport.cpp
parent846e61a3636fe8f22f86fcab92bc19f8234ed421 (diff)
downloadbcm5719-llvm-d60b72f6964fe65f36b1bf15f47adc84d0091ec6.tar.gz
bcm5719-llvm-d60b72f6964fe65f36b1bf15f47adc84d0091ec6.zip
Fix a regression in wide character codegen. See PR11369.
llvm-svn: 144521
Diffstat (limited to 'clang/lib/Lex/LiteralSupport.cpp')
-rw-r--r--clang/lib/Lex/LiteralSupport.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index 16f02f41306..296a89461f8 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -1095,13 +1095,13 @@ void StringLiteralParser::init(const Token *StringToks, unsigned NumStringToks){
// FIXME: Make the type of the result buffer correct instead of
// using reinterpret_cast.
UTF32 *ResultWidePtr = reinterpret_cast<UTF32*>(ResultPtr);
- *ResultWidePtr = ResultChar & 0xFF;
+ *ResultWidePtr = ResultChar;
ResultPtr += 4;
} else if (CharByteWidth == 2) {
// FIXME: Make the type of the result buffer correct instead of
// using reinterpret_cast.
UTF16 *ResultWidePtr = reinterpret_cast<UTF16*>(ResultPtr);
- *ResultWidePtr = ResultChar & 0xFF;
+ *ResultWidePtr = ResultChar & 0xFFFF;
ResultPtr += 2;
} else {
assert(CharByteWidth == 1 && "Unexpected char width");
OpenPOWER on IntegriCloud