Resync files in the binutils repository that are maintained in the gcc repository.
[deliverable/binutils-gdb.git] / libiberty / cp-demangle.c
index 2988b6bcb01a3be2108b87c10640c437daf4b068..fb1c4e5e9d5bcef89d5ad1628cbfada1d893dc06 100644 (file)
@@ -1302,7 +1302,12 @@ d_encoding (struct d_info *di, int top_level)
 static struct demangle_component *
 d_abi_tags (struct d_info *di, struct demangle_component *dc)
 {
+  struct demangle_component *hold_last_name;
   char peek;
+
+  /* Preserve the last name, so the ABI tag doesn't clobber it.  */
+  hold_last_name = di->last_name;
+
   while (peek = d_peek_char (di),
         peek == 'B')
     {
@@ -1311,6 +1316,9 @@ d_abi_tags (struct d_info *di, struct demangle_component *dc)
       tag = d_source_name (di);
       dc = d_make_comp (di, DEMANGLE_COMPONENT_TAGGED_NAME, dc, tag);
     }
+
+  di->last_name = hold_last_name;
+
   return dc;
 }
 
This page took 0.025144 seconds and 4 git commands to generate.