aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2008-03-31 18:11:50 +0000
committerDJ Delorie <dj@redhat.com>2008-03-31 18:11:50 +0000
commitdddc49b73b64226e8240adde0bf6ffb307d4e880 (patch)
tree3626d9d36388502f9be73e01cf95f10e6e00f07f /libiberty/cp-demangle.c
parent3a3b672568f59c5130cd4c48532937b13572ac16 (diff)
downloadgdb-dddc49b73b64226e8240adde0bf6ffb307d4e880.zip
gdb-dddc49b73b64226e8240adde0bf6ffb307d4e880.tar.gz
gdb-dddc49b73b64226e8240adde0bf6ffb307d4e880.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index edcfedc..82107bc 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1,5 +1,6 @@
/* Demangler for g++ V3 ABI.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@wasabisystems.com>.
This file is part of the libiberty library, which is part of GCC.
@@ -2681,21 +2682,24 @@ d_substitution (struct d_info *di, int prefix)
c = d_next_char (di);
if (c == '_' || IS_DIGIT (c) || IS_UPPER (c))
{
- int id;
+ unsigned int id;
id = 0;
if (c != '_')
{
do
{
+ unsigned int new_id;
+
if (IS_DIGIT (c))
- id = id * 36 + c - '0';
+ new_id = id * 36 + c - '0';
else if (IS_UPPER (c))
- id = id * 36 + c - 'A' + 10;
+ new_id = id * 36 + c - 'A' + 10;
else
return NULL;
- if (id < 0)
+ if (new_id < id)
return NULL;
+ id = new_id;
c = d_next_char (di);
}
while (c != '_');
@@ -2703,7 +2707,7 @@ d_substitution (struct d_info *di, int prefix)
++id;
}
- if (id >= di->next_sub)
+ if (id >= (unsigned int) di->next_sub)
return NULL;
++di->did_subs;