[PATCH] D144168: StackProtector: instrument noreturn paths before the call

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 01:24:56 PST 2023


t.p.northover created this revision.
Herald added subscribers: luke, frasercrmck, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, mcrosier.
Herald added a project: All.
t.p.northover requested review of this revision.
Herald added subscribers: pcwang-thead, MaskRay.
Herald added a project: LLVM.

Like the recent IR-level patch, this adds the ability for the stack protector to instrument a `noreturn` call followed by an `unreachable` if it's the SelectionDAG logic inserting the checks. This covers the interesting case of a call to `_Unwind_Resume` (or similar) along an exception cleanup path.


https://reviews.llvm.org/D144168

Files:
  llvm/lib/CodeGen/CodeGenCommonISel.cpp
  llvm/lib/CodeGen/StackProtector.cpp
  llvm/test/CodeGen/AArch64/stackprotect-noreturn.ll
  llvm/test/CodeGen/ARM/stackprotect-noreturn.ll
  llvm/test/CodeGen/RISCV/stackprotect-noreturn.ll
  llvm/test/CodeGen/X86/reverse_branches.ll
  llvm/test/CodeGen/X86/stack-protector-no-return.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144168.497925.patch
Type: text/x-patch
Size: 16485 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230216/ad4285c0/attachment.bin>


More information about the llvm-commits mailing list