[all-commits] [llvm/llvm-project] 5bf4f2: [SystemZ] Add range checks for PC-relative fixups.

Jonas Paulsson via All-commits all-commits at lists.llvm.org
Tue Dec 7 10:14:53 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bf4f2acb8d658904304460a937f24a071d9c9a7
      https://github.com/llvm/llvm-project/commit/5bf4f2acb8d658904304460a937f24a071d9c9a7
  Author: Jonas Paulsson <paulsson at linux.vnet.ibm.com>
  Date:   2021-12-07 (Tue, 07 Dec 2021)

  Changed paths:
    M llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp
    M llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCCodeEmitter.cpp
    A llvm/test/MC/SystemZ/fixups-out-of-range-01.s
    A llvm/test/MC/SystemZ/fixups-out-of-range-02.s
    R llvm/test/MC/SystemZ/fixups-out-of-range.s

  Log Message:
  -----------
  [SystemZ] Add range checks for PC-relative fixups.

The AsmParser checks the range of a PC-relative operand, but only if it is
immediate.

This patch adds range checks for operands in applyFixup(), at which point the
offset to a label is known.

The diagnostic message for an operand that is out of range is explicit (with
given value and min/max limits). This is now also done for displacement
fixups.

Review: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D114194




More information about the All-commits mailing list