[PATCH] D158379: [RISCV] Add bounds check before use on returned iterator during frame lowering.

Anmol P. Paralkar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 20 19:14:48 PDT 2023


anmolparalkar-nxp created this revision.
anmolparalkar-nxp added reviewers: asb, wangpc.
Herald added subscribers: jobnoorman, luke, sunshaoce, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
anmolparalkar-nxp requested review of this revision.
Herald added subscribers: llvm-commits, eopXD, MaskRay.
Herald added a project: LLVM.

Check iterator validity before use; fixes a crash seen in RISCVFrameLowering
when executing the Prologue/Epilogue Insertion & Frame Finalization pass.
Note: -mattr=+zcmp is essential to the reproducibility of the issue.


https://reviews.llvm.org/D158379

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/test/CodeGen/RISCV/frame-lowering-crash.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158379.551878.patch
Type: text/x-patch
Size: 4499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230821/e711126b/attachment.bin>


More information about the llvm-commits mailing list