From 5210f3d05f10ed390e20808f1eeeff473a448a7e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 17 Aug 1998 18:39:16 +0000 Subject: [PATCH] cplus-dem.c (do_type): Fix simple array handling. * cplus-dem.c (do_type): Fix simple array handling. If we fail, stay failed. From-SVN: r21798 --- libiberty/ChangeLog | 5 +++++ libiberty/cplus-dem.c | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 1cb3bdbf8dd..30a7920bd54 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +1998-08-17 Jason Merrill + + * cplus-dem.c (do_type): Fix simple array handling. If we fail, + stay failed. + Mon Aug 17 10:40:34 1998 Kaveh R. Ghazi * cplus-dem.c: Include config.h if it exists. Also, only diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index 60c3ce96528..1f3dc529efa 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -2491,10 +2491,15 @@ do_type (work, mangled, result) case 'A': { ++(*mangled); - string_prepend (&decl, "("); - string_append (&decl, ")["); - success = demangle_template_value_parm (work, mangled, &decl, - tk_integral); + if (!STRING_EMPTY (&decl) && decl.b[0] == '*') + { + string_prepend (&decl, "("); + string_append (&decl, ")"); + } + string_append (&decl, "["); + if (**mangled != '_') + success = demangle_template_value_parm (work, mangled, &decl, + tk_integral); if (**mangled == '_') ++(*mangled); string_append (&decl, "]"); @@ -2651,7 +2656,7 @@ do_type (work, mangled, result) } } - switch (**mangled) + if (success) switch (**mangled) { /* A qualified name, such as "Outer::Inner". */ case 'Q': @@ -2665,7 +2670,7 @@ do_type (work, mangled, result) case 'B': (*mangled)++; if (!get_count (mangled, &n) || n >= work -> numb) - success = 0; + success = 0; else string_append (result, work->btypevec[n]); break;