From 66393f0e7cf1a2caa35ddbc6cbfaa29a7439c1dd Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 3 Nov 1998 20:28:12 +0000 Subject: [PATCH] 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. --- gdb/ChangeLog | 5 +++++ gdb/c-exp.y | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 909f9290da..0746193227 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +1998-11-03 Jim Wilson + + * c-exp.y (parse_number): Check TARGET_LONG_LONG_BIT when setting + high_bit to avoid undefined negative shift. + Mon Nov 2 15:26:33 1998 Geoffrey Noer * configure.in: Check cygwin* instead of cygwin32*. diff --git a/gdb/c-exp.y b/gdb/c-exp.y index a6d21aebdd..38279f3fc6 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 = -- 2.34.1