aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-31 15:55:20 +0930
committerAlan Modra <amodra@gmail.com>2020-08-31 20:28:12 +0930
commit51bf29b1f75b811f8b398543e164798244ec9cc3 (patch)
treef3343081c8aa02ff14d04d9f8c78f2a7fd2c80c0
parentbaeb994f3f6bf2b416676ad269f262675ab9d774 (diff)
downloadgdb-51bf29b1f75b811f8b398543e164798244ec9cc3.zip
gdb-51bf29b1f75b811f8b398543e164798244ec9cc3.tar.gz
gdb-51bf29b1f75b811f8b398543e164798244ec9cc3.tar.bz2
PR26480 UBSAN: tc-nios2.c:1634 left shift cannot be represented
PR 26480 * config/tc-nios2.c (nios2_parse_reglist): Shift 1UL left.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-nios2.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3f615cf..791a1f1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2020-08-31 Alan Modra <amodra@gmail.com>
+ PR 26480
+ * config/tc-nios2.c (nios2_parse_reglist): Shift 1UL left.
+
+2020-08-31 Alan Modra <amodra@gmail.com>
+
PR 26479
* config/tc-nios2.c (md_chars_to_number): Cast buf[i] before shifting.
diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
index 16695c5..0134b15 100644
--- a/gas/config/tc-nios2.c
+++ b/gas/config/tc-nios2.c
@@ -1631,7 +1631,7 @@ nios2_parse_reglist (char *token, const struct nios2_opcode *op)
}
}
- mask |= 1 << regno;
+ mask |= 1UL << regno;
last = regno;
}