aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog8
-rw-r--r--opcodes/aarch64-opc.c6
-rw-r--r--opcodes/tic6x-dis.c7
3 files changed, 16 insertions, 5 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 3070ad5..2185484 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,11 @@
+2017-02-03 Nick Clifton <nickc@redhat.com>
+
+ PR 21096
+ * aarch64-opc.c (print_register_list): Ensure that the register
+ list index will fir into the tb buffer.
+ (print_register_offset_address): Likewise.
+ * tic6x-dis.c (print_insn_tic6x): Increase size of func_unit_buf.
+
2017-01-27 Alexis Deruell <alexis.deruelle@gmail.com>
PR 21056
diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c
index eea76c8..314bcb4 100644
--- a/opcodes/aarch64-opc.c
+++ b/opcodes/aarch64-opc.c
@@ -2865,7 +2865,8 @@ print_register_list (char *buf, size_t size, const aarch64_opnd_info *opnd,
/* Prepare the index if any. */
if (opnd->reglist.has_index)
- snprintf (tb, 8, "[%" PRIi64 "]", opnd->reglist.index);
+ /* PR 21096: The %100 is to silence a warning about possible truncation. */
+ snprintf (tb, 8, "[%" PRIi64 "]", (opnd->reglist.index % 100));
else
tb[0] = '\0';
@@ -2965,7 +2966,8 @@ print_register_offset_address (char *buf, size_t size,
{
if (print_amount_p)
snprintf (tb, sizeof (tb), ", %s #%" PRIi64, shift_name,
- opnd->shifter.amount);
+ /* PR 21096: The %100 is to silence a warning about possible truncation. */
+ (opnd->shifter.amount % 100));
else
snprintf (tb, sizeof (tb), ", %s", shift_name);
}
diff --git a/opcodes/tic6x-dis.c b/opcodes/tic6x-dis.c
index 1a6f575..48046b2 100644
--- a/opcodes/tic6x-dis.c
+++ b/opcodes/tic6x-dis.c
@@ -316,7 +316,7 @@ print_insn_tic6x (bfd_vma addr, struct disassemble_info *info)
const char *parallel;
const char *cond = "";
const char *func_unit;
- char func_unit_buf[7];
+ char func_unit_buf[8];
unsigned int func_unit_side = 0;
unsigned int func_unit_data_side = 0;
unsigned int func_unit_cross = 0;
@@ -703,8 +703,9 @@ print_insn_tic6x (bfd_vma addr, struct disassemble_info *info)
if (opc->flags & TIC6X_FLAG_INSN16_BSIDE && func_unit_side == 1)
func_unit_cross = 1;
- snprintf (func_unit_buf, 7, " .%c%u%s%s", func_unit_char,
- func_unit_side, (func_unit_cross ? "X" : ""), data_str);
+ snprintf (func_unit_buf, sizeof func_unit_buf, " .%c%u%s%s",
+ func_unit_char, func_unit_side,
+ (func_unit_cross ? "X" : ""), data_str);
func_unit = func_unit_buf;
}