Skip to content

Commit

Permalink
* cplus-dem.c (demangle_integral_value): Correction to reflect
Browse files Browse the repository at this point in the history
patch of 2002-01-10 in order to also make negative multi-digits
without leading underscore work.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64179 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
dj committed Mar 11, 2003
1 parent 529825b commit 68f6f1d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 23 deletions.
6 changes: 6 additions & 0 deletions libiberty/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2003-03-11 Carlo Wood <carlo@gnu.org>

* cplus-dem.c (demangle_integral_value): Correction to reflect
patch of 2002-01-10 in order to also make negative multi-digits
without leading underscore work.

2003-03-03 Mark Mitchell <mark@codesourcery.com>

* cplus-dem.c: Add license exception to copyright notice.
Expand Down
49 changes: 26 additions & 23 deletions libiberty/cplus-dem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,31 +1797,34 @@ demangle_integral_value (work, mangled, s)

success = 0;

/* Negative numbers are indicated with a leading `m'. */
if (**mangled == 'm')
{
string_appendn (s, "-", 1);
(*mangled)++;
}
else if (mangled[0][0] == '_' && mangled[0][1] == 'm')
{
/* Since consume_count_with_underscores does not handle the
`m'-prefix we must do it here, using consume_count and
adjusting underscores: we have to consume the underscore
matching the prepended one. */
multidigit_without_leading_underscore = 1;
string_appendn (s, "-", 1);
(*mangled) += 2;
}
else if (**mangled == '_')
{
/* Do not consume a following underscore;
multidigit_without_leading_underscore will consume what should be
consumed. */
leave_following_underscore = 1;
if (**mangled == '_')
{
if (mangled[0][1] == 'm')
{
/* Since consume_count_with_underscores does not handle the
`m'-prefix we must do it here, using consume_count and
adjusting underscores: we have to consume the underscore
matching the prepended one. */
multidigit_without_leading_underscore = 1;
string_appendn (s, "-", 1);
(*mangled) += 2;
}
else
{
/* Do not consume a following underscore;
consume_count_with_underscores will consume what
should be consumed. */
leave_following_underscore = 1;
}
}
else
{
/* Negative numbers are indicated with a leading `m'. */
if (**mangled == 'm')
{
string_appendn (s, "-", 1);
(*mangled)++;
}
/* Since consume_count_with_underscores does not handle
multi-digit numbers that do not start with an underscore,
and this number can be an integer template parameter,
Expand Down Expand Up @@ -1862,7 +1865,7 @@ demangle_integral_value (work, mangled, s)
/* All is well. */
success = 1;
}
}
}

return success;
}
Expand Down

0 comments on commit 68f6f1d

Please sign in to comment.