[PATCH] D36732: [ARM, Asm] Harden GNU LDRD/STRD aliases against invalid inputs

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 04:01:13 PDT 2017


olista01 created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D36732

Files:
  lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  test/MC/ARM/ldrd-strd-gnu-arm-bad-regs.s
  test/MC/ARM/ldrd-strd-gnu-bad-inst.s
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36732.111141.patch
Type: text/x-patch
Size: 8254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170815/a3f2058b/attachment.bin>


More information about the llvm-commits mailing list