aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-03 21:47:08 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-03 21:47:08 +0000
commit434da48d0e35764f18b3fc96c75504746050b046 (patch)
tree65268e40caa8cc6f239ac2033fc6d38980fbb99e /lib/CodeGen/CodeGenModule.cpp
parent968f0a6fe860b7df42d5ea1ab87a55c757507c1c (diff)
Make sure UTF-16 strings end with a 16-bit null (as opposed to 8-bit).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 51fa3302a2..08dc9930ba 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1251,6 +1251,9 @@ GetConstantCFStringEntry(llvm::StringMap<llvm::Constant*> &Map,
AsBytes.push_back(Val & 0xFF);
}
}
+ // Append one extra null character, the second is automatically added by our
+ // caller.
+ AsBytes.push_back(0);
IsUTF16 = true;
return Map.GetOrCreateValue(llvm::StringRef(AsBytes.data(), AsBytes.size()));