summaryrefslogtreecommitdiffstats
path: root/clang/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
commit4d93a4f9d4b3994addbdc6aa3e3d5d81fef33710 (patch)
tree23fdb3b4ef3b98d279a7e77c82fb45ed478d2794 /clang/lib/CodeGen/CodeGenModule.cpp
parent0bb32e3e5d7524022642a8055da3ffe32ea5952a (diff)
downloadbcm5719-llvm-4d93a4f9d4b3994addbdc6aa3e3d5d81fef33710.tar.gz
bcm5719-llvm-4d93a4f9d4b3994addbdc6aa3e3d5d81fef33710.zip
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.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 51fa3302a23..08dc9930ba3 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()));
OpenPOWER on IntegriCloud