diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-08-03 21:47:08 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-03 21:47:08 +0000 |
| commit | 4d93a4f9d4b3994addbdc6aa3e3d5d81fef33710 (patch) | |
| tree | 23fdb3b4ef3b98d279a7e77c82fb45ed478d2794 /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 0bb32e3e5d7524022642a8055da3ffe32ea5952a (diff) | |
Make sure UTF-16 strings end with a 16-bit null (as opposed to 8-bit).
llvm-svn: 78001
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 51fa3302a238..08dc9930ba3d 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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())); |
