Commit 229b8ec7 by Alex Samuel Committed by Alex Samuel

cp-demangle.c (demangle_special_name): Swap base and derived class when…

cp-demangle.c (demangle_special_name): Swap base and derived class when demangling construction vtables.

	* cp-demangle.c (demangle_special_name): Swap base and derived
	class when demangling construction vtables.

From-SVN: r34751
parent 06772c7d
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> 2000-06-21 Alex Samuel <samuel@codesourcery.com>
* cp-demangle.c: Don't include ctype.h. * cp-demangle.c: Don't include ctype.h.
......
...@@ -1682,19 +1682,38 @@ demangle_special_name (dm) ...@@ -1682,19 +1682,38 @@ demangle_special_name (dm)
/* TC is a special g++ mangling for a construction vtable. */ /* TC is a special g++ mangling for a construction vtable. */
if (!flag_strict) if (!flag_strict)
{ {
dyn_string_t derived_type;
advance_char (dm); advance_char (dm);
RETURN_IF_ERROR (result_append (dm, "construction vtable for ")); 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)); RETURN_IF_ERROR (demangle_type (dm));
derived_type = (dyn_string_t) result_pop (dm);
/* Demangle the offset. */ /* Demangle the offset. */
number = dyn_string_new (4); number = dyn_string_new (4);
if (number == NULL) if (number == NULL)
return STATUS_ALLOCATION_FAILED; {
dyn_string_delete (derived_type);
return STATUS_ALLOCATION_FAILED;
}
demangle_number_literally (dm, number, 10, 1); demangle_number_literally (dm, number, 10, 1);
/* Demangle the underscore separator. */ /* Demangle the underscore separator. */
RETURN_IF_ERROR (demangle_char (dm, '_')); status = demangle_char (dm, '_');
/* Demangle the base type. */ /* Demangle the base type. */
RETURN_IF_ERROR (result_append (dm, "-in-")); if (STATUS_NO_ERROR (status))
RETURN_IF_ERROR (demangle_type (dm)); 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. */ /* Don't display the offset unless in verbose mode. */
if (flag_verbose) if (flag_verbose)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment