From: Jakub Jelinek Date: Fri, 23 Mar 2001 22:12:55 +0000 (+0100) Subject: mangle.c (write_discriminator): Use `_0' for discriminator 1, not `_'. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f1a0345cf6f425df0b5b49f1a5de97cca2232c03;p=gcc.git mangle.c (write_discriminator): Use `_0' for discriminator 1, not `_'. * mangle.c (write_discriminator): Use `_0' for discriminator 1, not `_'. * cp-demangle.c (demangle_discriminator): `_0' is discriminator #1, `_' not followed by a digit is invalid. From-SVN: r40795 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2881da6ab5e..5f63a6785cf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2001-03-23 Jakub Jelinek + + * mangle.c (write_discriminator): Use `_0' for discriminator 1, + not `_'. + 2001-03-23 Jakub Jelinek * decl.c (local_names): Define. diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index a908640088e..e2641a74c6e 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1196,10 +1196,7 @@ write_discriminator (discriminator) if (discriminator > 0) { write_char ('_'); - /* The number is omitted for discriminator == 1. Beyond 1, the - numbering starts at 0. */ - if (discriminator > 1) - write_unsigned_number (discriminator - 2); + write_unsigned_number (discriminator - 1); } } diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 0e937d2cfb3..7a1e8268551 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2001-03-23 Jakub Jelinek + + * cp-demangle.c (demangle_discriminator): `_0' is discriminator #1, + `_' not followed by a digit is invalid. + 2001-03-22 Jim Blandy * cp-demangle.c (string_list_delete): Use dyn_string_delete diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index b8255b3a26c..8419eef3425 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -3446,15 +3446,11 @@ demangle_discriminator (dm, suppress_first) /* Write the discriminator. The mangled number is two less than the discriminator ordinal, counting from zero. */ - RETURN_IF_ERROR (int_to_dyn_string (discriminator + 2, + RETURN_IF_ERROR (int_to_dyn_string (discriminator + 1, (dyn_string_t) dm->result)); } else - { - if (flag_verbose) - /* A missing digit correspond to one. */ - RETURN_IF_ERROR (result_add_char (dm, '1')); - } + return STATUS_ERROR; if (flag_verbose) RETURN_IF_ERROR (result_add_char (dm, ']')); }