]> gcc.gnu.org Git - gcc.git/commitdiff
cp-demangle.c (demangle_special_name): Swap base and derived class when demangling...
authorAlex Samuel <samuel@codesourcery.com>
Wed, 28 Jun 2000 06:08:27 +0000 (06:08 +0000)
committerAlex Samuel <samuel@gcc.gnu.org>
Wed, 28 Jun 2000 06:08:27 +0000 (06:08 +0000)
* cp-demangle.c (demangle_special_name): Swap base and derived
class when demangling construction vtables.

From-SVN: r34751

libiberty/ChangeLog
libiberty/cp-demangle.c

index 5bac397881e0b82d2f88f8a48bc71cc06fdf45ea..ad5c214e6470ac10b95cd22cbaffd4bebaf84704 100644 (file)
@@ -1,3 +1,8 @@
+2000-06-27  Alex Samuel  <samuel@codesourcery.com>
+
+       * cp-demangle.c (demangle_special_name): Swap base and derived
+       class when demangling construction vtables.
+
 2000-06-21  Alex Samuel  <samuel@codesourcery.com>
 
        * cp-demangle.c: Don't include ctype.h.
index 651f7aa2704ad9181fcd9d56f101e71f21a9e341..b658b40d9ffed9d287fb25d26e68b8f4b4a19921 100644 (file)
@@ -1682,19 +1682,38 @@ demangle_special_name (dm)
          /* TC is a special g++ mangling for a construction vtable. */
          if (!flag_strict)
            {
+             dyn_string_t derived_type;
+
              advance_char (dm);
              RETURN_IF_ERROR (result_append (dm, "construction vtable for "));
+
+             /* Demangle the derived type off to the side.  */
+             RETURN_IF_ERROR (result_push (dm));
              RETURN_IF_ERROR (demangle_type (dm));
+             derived_type = (dyn_string_t) result_pop (dm);
+
              /* Demangle the offset.  */
              number = dyn_string_new (4);
              if (number == NULL)
-               return STATUS_ALLOCATION_FAILED;
+               {
+                 dyn_string_delete (derived_type);
+                 return STATUS_ALLOCATION_FAILED;
+               }
              demangle_number_literally (dm, number, 10, 1);
              /* Demangle the underscore separator.  */
-             RETURN_IF_ERROR (demangle_char (dm, '_'));
+             status = demangle_char (dm, '_');
+
              /* Demangle the base type.  */
-             RETURN_IF_ERROR (result_append (dm, "-in-"));
-             RETURN_IF_ERROR (demangle_type (dm));
+             if (STATUS_NO_ERROR (status))
+               status = demangle_type (dm);
+
+             /* Emit the derived type.  */
+             if (STATUS_NO_ERROR (status))
+               status = result_append (dm, "-in-");
+             if (STATUS_NO_ERROR (status))
+               status = result_append_string (dm, derived_type);
+             dyn_string_delete (derived_type);
+
              /* Don't display the offset unless in verbose mode.  */
              if (flag_verbose)
                {
This page took 0.076406 seconds and 5 git commands to generate.