projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6228e27
)
ubsan: tc-z80.c:3656 shift exponent 32 is too large
author
Alan Modra
<amodra@gmail.com>
Wed, 2 Sep 2020 00:56:31 +0000
(10:26 +0930)
committer
Alan Modra
<amodra@gmail.com>
Wed, 2 Sep 2020 07:00:43 +0000
(16:30 +0930)
* config/tc-z80.c (is_overflow): Avoid too large shift.
gas/ChangeLog
patch
|
blob
|
history
gas/config/tc-z80.c
patch
|
blob
|
history
diff --git
a/gas/ChangeLog
b/gas/ChangeLog
index d6b58b485273992abc7bdbbfcd5f8ba70ced5776..641b68de66afc67be53c275569540f504189c26f 100644
(file)
--- a/
gas/ChangeLog
+++ b/
gas/ChangeLog
@@
-1,3
+1,7
@@
+2020-09-02 Alan Modra <amodra@gmail.com>
+
+ * config/tc-z80.c (is_overflow): Avoid too large shift.
+
2020-09-02 Alan Modra <amodra@gmail.com>
* config/tc-sparc.c (in_signed_range): Use an unsigned type for
diff --git
a/gas/config/tc-z80.c
b/gas/config/tc-z80.c
index 45fcd6fbf74b5fb86e238401cfbe79c18e301407..2e17d00552271a6f16189fe9adf697f53b7e384f 100644
(file)
--- a/
gas/config/tc-z80.c
+++ b/
gas/config/tc-z80.c
@@
-3653,7
+3653,7
@@
md_assemble (char *str)
static int
is_overflow (long value, unsigned bitsize)
{
- long fieldmask = (
1UL << bitsize
) - 1;
+ long fieldmask = (
2UL << (bitsize - 1)
) - 1;
long signmask = ~fieldmask;
long a = value & fieldmask;
long ss = a & signmask;