mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-01-22 09:04:58 +00:00
* p-exp.y (parse_number): Avoid shift overflow when ``long''.
Code copied from c-exp.y.
This commit is contained in:
parent
177495c907
commit
7451d02767
@ -1,3 +1,8 @@
|
||||
2001-03-17 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* p-exp.y (parse_number): Avoid shift overflow when ``long''.
|
||||
Code copied from c-exp.y.
|
||||
|
||||
2001-03-18 Kevin Buettner <kevinb@redhat.com>
|
||||
|
||||
* acconfig.h (HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS)
|
||||
|
13
gdb/p-exp.y
13
gdb/p-exp.y
@ -858,14 +858,13 @@ parse_number (p, len, parsed_float, putithere)
|
||||
}
|
||||
else
|
||||
{
|
||||
high_bit = (((ULONGEST)1)
|
||||
<< (TARGET_LONG_LONG_BIT - 32 - 1)
|
||||
<< 16
|
||||
<< 16);
|
||||
if (high_bit == 0)
|
||||
int shift;
|
||||
if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
|
||||
/* A long long does not fit in a LONGEST. */
|
||||
high_bit =
|
||||
(ULONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1);
|
||||
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
|
||||
else
|
||||
shift = (TARGET_LONG_LONG_BIT - 1);
|
||||
high_bit = (ULONGEST) 1 << shift;
|
||||
unsigned_type = builtin_type_unsigned_long_long;
|
||||
signed_type = builtin_type_long_long;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user