* cp-demangle.c (d_substitution): Correct overflow check to avoid
-fstrict-overflow optimizations.
From-SVN: r133761
+2008-03-31 Ian Lance Taylor <iant@google.com>
+
+ * cp-demangle.c (d_substitution): Correct overflow check to avoid
+ -fstrict-overflow optimizations.
+
2008-03-27 Paolo Bonzini <bonzini@gnu.org>
* configure.ac (frags): Don't set, use frag instead.
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 != '_');
++id;
}
- if (id >= di->next_sub)
+ if (id >= (unsigned int) di->next_sub)
return NULL;
++di->did_subs;