aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/mangle_name.c
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@redhat.com>2001-02-09 12:29:08 -0800
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2001-02-09 12:29:08 -0800
commit1e97aa4083fc908cc500a1f53340dfa7b80a68f3 (patch)
tree5d1b21d1dd34dce39026d3ef17ffe2377fed19cf /gcc/java/mangle_name.c
parentce675456284e5878b4cf8980b15114fca7b5a49a (diff)
downloadgcc-1e97aa4083fc908cc500a1f53340dfa7b80a68f3.zip
gcc-1e97aa4083fc908cc500a1f53340dfa7b80a68f3.tar.gz
gcc-1e97aa4083fc908cc500a1f53340dfa7b80a68f3.tar.bz2
mangle_name.c (append_unicode_mangled_name): Emit `_' or `U' outside of the `__U' sequence too.
2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com> * mangle_name.c (append_unicode_mangled_name): Emit `_' or `U' outside of the `__U' sequence too. (unicode_mangling_length): Count `_' or `U' outside of the `__U' sequence too. (http://gcc.gnu.org/ml/gcc-patches/2001-02/msg00532.html) From-SVN: r39570
Diffstat (limited to 'gcc/java/mangle_name.c')
-rw-r--r--gcc/java/mangle_name.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/java/mangle_name.c b/gcc/java/mangle_name.c
index b074f1e..101dee7 100644
--- a/gcc/java/mangle_name.c
+++ b/gcc/java/mangle_name.c
@@ -113,6 +113,13 @@ append_unicode_mangled_name (name, len)
uuU = 0;
obstack_grow (mangle_obstack, "U_", 2);
}
+ /* Otherwise, just reset uuU and emit the character we
+ have. */
+ else
+ {
+ uuU = 0;
+ obstack_1grow (mangle_obstack, ch);
+ }
continue;
}
sprintf (buf, "__U%x_", ch);
@@ -156,19 +163,25 @@ unicode_mangling_length (name, len)
if (ch == '_' || ch == 'U')
{
+ /* It's always at least one character. */
+ num_chars++;
+
/* Prepare to recognize __U */
if (ch == '_' && (uuU < 3))
- {
- num_chars++;
- uuU++;
- }
- /* We recognize __U that we wish to encode __U_ */
+ uuU++;
+
+ /* We recognize __U that we wish to encode __U_, we
+ count one more character. */
else if (ch == 'U' && (uuU == 2))
{
- num_chars += 2;
+ num_chars++;
need_escapes = 1;
uuU = 0;
}
+ /* Otherwise, just reset uuU */
+ else
+ uuU = 0;
+
continue;
}