From 3b0ec529f240d74205b50748054b276ca301aed7 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 25 Apr 2000 08:55:01 +0000 Subject: [PATCH] Keep shift count smaller than 32. --- gas/ChangeLog | 5 +++++ gas/config/tc-i386.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 3401f763d1f..ddf73f1a990 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2000-04-25 Alan Modra + + * config/tc-i386.c (offset_in_range): Ensure shift counts are less + than 32. + 2000-04-24 Nick Clifton * doc/c-arm.texi (ARM Directives): Document behaviour of .align 0. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index f7e3c3485f7..c9294a5ff1b 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -471,12 +471,12 @@ offset_in_range (val, size) { case 1: mask = ((addressT) 1 << 8) - 1; break; case 2: mask = ((addressT) 1 << 16) - 1; break; - case 4: mask = ((addressT) 1 << 32) - 1; break; + case 4: mask = ((addressT) 2 << 31) - 1; break; default: abort(); } /* If BFD64, sign extend val. */ - if ((val & ~ (((addressT) 1 << 32) - 1)) == 0) + if ((val & ~ (((addressT) 2 << 31) - 1)) == 0) val = (val ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31); if ((val & ~ mask) != 0 && (val & ~ mask) != ~ mask) -- 2.30.2