diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-06-28 09:21:04 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2016-06-28 09:21:04 +0100 |
commit | dab26bf4e7c8b48e0c5ffbef1c5400807b78072c (patch) | |
tree | 31f50ffc2bc35617ba70fe0f12d13b6332390e50 /binutils/syslex.l | |
parent | c9775dde32773c57d4eb5dfb4265eda9cb8adbe8 (diff) | |
download | gdb-dab26bf4e7c8b48e0c5ffbef1c5400807b78072c.zip gdb-dab26bf4e7c8b48e0c5ffbef1c5400807b78072c.tar.gz gdb-dab26bf4e7c8b48e0c5ffbef1c5400807b78072c.tar.bz2 |
[AArch64] Make register indices be full 64-bit values
aarch64_opnd_info used bitfields to hold vector element indices,
but values were stored into those bitfields before their ranges had
been checked. This meant large invalid indices could be silently
truncated to smaller valid indices.
The two obvious fixes were to do the range checking earlier or use
a full 64-bit field for the index. I went for the latter for two
reasons:
- Doing the range checking in operand_general_constraint_met_p
seems structurally cleaner than doing it while parsing.
- The bitfields didn't really buy us anything. The imm field
of the union is already 128 bits, so we can use a full int64_t
index without growing the structure.
The patch also adds missing range checks for the elements in a register
list index.
include/
* opcode/aarch64.h (aarch64_opnd_info): Change index fields to int64_t.
opcodes/
* aarch64-opc.c (operand_general_constraint_met_p): Check the
range of ldst_elemlist operands.
(print_register_list): Use PRIi64 to print the index.
(aarch64_print_operand): Likewise.
gas/
* testsuite/gas/aarch64/diagnostic.s,
testsuite/gas/aarch64/diagnostic.l: Add tests for out-of-range indices.
Diffstat (limited to 'binutils/syslex.l')
0 files changed, 0 insertions, 0 deletions