summaryrefslogtreecommitdiff
path: root/lib/Lex/LiteralSupport.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-06-13 05:41:29 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-06-13 05:41:29 +0000
commit59b26d84b64510158e23d80eba077b844b7e0b04 (patch)
tree0005117b8e6556da67dbcb0d17546d0c5607b3f1 /lib/Lex/LiteralSupport.cpp
parentdf9ef1bc8c3780307ab2ed81bf5e31c23310b936 (diff)
downloadclang-59b26d84b64510158e23d80eba077b844b7e0b04.tar.gz
clang-59b26d84b64510158e23d80eba077b844b7e0b04.tar.bz2
clang-59b26d84b64510158e23d80eba077b844b7e0b04.tar.xz
Fix off-by-one error in UTF-16 encoding: don't try to use a surrogate pair for U+FFFF.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158391 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 2930d6a5ff..9b0bc70345 100644
--- a/lib/Lex/LiteralSupport.cpp
+++ b/lib/Lex/LiteralSupport.cpp
@@ -322,7 +322,7 @@ static void EncodeUCNEscape(const char *ThisTokBegin, const char *&ThisTokBuf,
// using reinterpret_cast.
UTF16 *ResultPtr = reinterpret_cast<UTF16*>(ResultBuf);
- if (UcnVal < (UTF32)0xFFFF) {
+ if (UcnVal <= (UTF32)0xFFFF) {
*ResultPtr = UcnVal;
ResultBuf += 2;
return;