]> granicus.if.org Git - llvm/commit
[ARM, Asm] Harden GNU LDRD/STRD aliases against invalid inputs
authorOliver Stannard <oliver.stannard@arm.com>
Tue, 10 Oct 2017 12:38:22 +0000 (12:38 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Tue, 10 Oct 2017 12:38:22 +0000 (12:38 +0000)
commit40bc0f3ba8b181391f09d720e80c3f378a6c7a4d
treeb72a3381deffec6efa7a4a6669177b86236be94c
parentdd15603e1305114cd3dc24c0eb40c1afeafbd7cf
[ARM, Asm] Harden GNU LDRD/STRD aliases against invalid inputs

Previously, the code that implemented the GNU assembler aliases for the
LDRD and STRD instructions (where the second register is omitted)
assumed that the input was a valid instruction. This caused assertion
failures for every example in ldrd-strd-gnu-bad-inst.s.

This improves this code so that it bails out if the instruction is not
in the expected format, the check bails out, and the asm parser is run
on the unmodified instruction.

It also relaxes the alias on thumb targets, so that unaligned pairs of
registers can be used. The restriction that Rt must be even-numbered
only applies to the ARM versions of these instructions.

Differential revision: https://reviews.llvm.org/D36732

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315305 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/ldrd-strd-gnu-arm-bad-regs.s [new file with mode: 0644]
test/MC/ARM/ldrd-strd-gnu-bad-inst.s [new file with mode: 0644]
test/MC/ARM/ldrd-strd-gnu-sp.s
test/MC/ARM/ldrd-strd-gnu-thumb-bad-regs.s
test/MC/ARM/ldrd-strd-gnu-thumb.s