ubsan: tc-nios2.c:1403 shift exponent 32 is too large
Alan Modra
amodra@gmail.com
Wed Sep 2 08:42:53 GMT 2020
More information about the Binutils mailing list
Wed Sep 2 08:42:53 GMT 2020
- Previous message (by thread): ubsan: tc-mips.c:9606 shift exponent 32 is too large
- Next message (by thread): ubsan: tc-sparc.c:1146 left shift cannot be represented
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
* config/tc-nios2.c (md_apply_fix): Avoid too large shift.
diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
index 0134b15ae0..5f0033a9f0 100644
--- a/gas/config/tc-nios2.c
+++ b/gas/config/tc-nios2.c
@@ -1400,7 +1400,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
break;
default:
{
- fixup &= ((valueT) 1 << howto->bitsize) - 1;
+ fixup &= ((valueT) 2 << (howto->bitsize - 1)) - 1;
break;
}
}
--
Alan Modra
Australia Development Lab, IBM
- Previous message (by thread): ubsan: tc-mips.c:9606 shift exponent 32 is too large
- Next message (by thread): ubsan: tc-sparc.c:1146 left shift cannot be represented
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list