[llvm-commits] [llvm-gcc-4.2] r78223 - /llvm-gcc-4.2/trunk/gcc/config/darwin-c.c
Dale Johannesen
dalej at apple.com
Wed Aug 5 11:59:53 PDT 2009
Author: johannes
Date: Wed Aug 5 13:59:35 2009
New Revision: 78223
URL: http://llvm.org/viewvc/llvm-project?rev=78223&view=rev
Log:
Pad UTF-16 strings with two null bytes, not one. 7095855.
(They're actually UTF-16LE, but comments say UTF-16 throughout.)
Modified:
llvm-gcc-4.2/trunk/gcc/config/darwin-c.c
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-c.c?rev=78223&r1=78222&r2=78223&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin-c.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Wed Aug 5 13:59:35 2009
@@ -1209,8 +1209,9 @@
for (l = 0; l < *numUniChars; l++)
initlist = tree_cons (NULL_TREE, build_int_cst (char_type_node, uniCharBuf[l]), initlist);
+ /* LLVM LOCAL utf16 has two trailing nulls 7095855 */
type = build_array_type (char_type_node,
- build_index_type (build_int_cst (NULL_TREE, *numUniChars)));
+ build_index_type (build_int_cst (NULL_TREE, *numUniChars + 1)));
name = (char *)alloca (strlen (name_prefix) + 10);
sprintf (name, "%s%d", name_prefix, ++num);
decl = build_decl (VAR_DECL, get_identifier (name), type);
More information about the llvm-commits
mailing list