aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorJim Wilson <wilson@tuliptree.org>1998-11-03 20:28:12 +0000
committerJim Wilson <wilson@tuliptree.org>1998-11-03 20:28:12 +0000
commit66393f0e7cf1a2caa35ddbc6cbfaa29a7439c1dd (patch)
tree708651041fb8563edf2da47dbe6f2c64057b9b09 /gdb/c-exp.y
parent29e9c76053f34485b55d7acfaf3fe8dd413d05fe (diff)
downloadgdb-66393f0e7cf1a2caa35ddbc6cbfaa29a7439c1dd.zip
gdb-66393f0e7cf1a2caa35ddbc6cbfaa29a7439c1dd.tar.gz
gdb-66393f0e7cf1a2caa35ddbc6cbfaa29a7439c1dd.tar.bz2
Fix mn10200 build failure on redhat 5.0 linux.
* c-exp.y (parse_number): Check TARGET_LONG_LONG_BIT when setting high_bit to avoid undefined negative shift.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index a6d21ae..38279f3 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1085,10 +1085,14 @@ parse_number (p, len, parsed_float, putithere)
}
else
{
- high_bit = (((ULONGEST)1)
- << (TARGET_LONG_LONG_BIT - 32 - 1)
- << 16
- << 16);
+ /* Avoid negative shift. */
+ if (TARGET_LONG_LONG_BIT <= 32)
+ high_bit = ((ULONGEST)1 << TARGET_LONG_LONG_BIT - 1);
+ else
+ high_bit = (((ULONGEST)1)
+ << (TARGET_LONG_LONG_BIT - 32 - 1)
+ << 16
+ << 16);
if (high_bit == 0)
/* A long long does not fit in a LONGEST. */
high_bit =