This commit was generated by cvs2svn to track changes on a CVS vendor
[binutils-gdb.git] / libiberty / cplus-dem.c
index 710b69d9c7a2b6afeeea0e46821b1815a50255ab..995757c62def374fee9cd491f061dac2630dc807 100644 (file)
@@ -305,8 +305,6 @@ const struct demangler_engine libiberty_demanglers[] =
 };
 
 #define STRING_EMPTY(str)      ((str) -> b == (str) -> p)
-#define PREPEND_BLANK(str)     {if (!STRING_EMPTY(str)) \
-    string_prepend(str, " ");}
 #define APPEND_BLANK(str)      {if (!STRING_EMPTY(str)) \
     string_append(str, " ");}
 #define LEN_STRING(str)         ( (STRING_EMPTY(str))?0:((str)->p - (str)->b))
@@ -2414,8 +2412,15 @@ demangle_arm_hp_template (work, mangled, n, declp)
             break;
           default:
             /* Not handling other HP cfront stuff */
-            if (!do_type (work, &args, &arg))
-              goto cfront_template_args_done;
+            {
+              const char* old_args = args;
+              if (!do_type (work, &args, &arg))
+                goto cfront_template_args_done;
+
+              /* Fail if we didn't make any progress: prevent infinite loop. */
+              if (args == old_args)
+                return;
+            }
          }
        string_appends (declp, &arg);
        string_append (declp, ",");