[PATCH] D154294: [Windows SEH]: Do not fold branches for MSVC TableSEH function

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 14:55:26 PDT 2023


rnk added a comment.

In D154294#4501723 <https://reviews.llvm.org/D154294#4501723>, @efriedma wrote:

> Can you look into adding EH edges to the relevant blocks?

I think it's less of a matter of missing edges, and more like a UAF bug. We are storing MBB pointers in a WinEHFuncInfo side table, and BranchFolding replaces the blocks in ways that I hope are valid for landingpads, but invalidate our references. Storing the MBB references on the side is safe if you believe that no backend pass would delete and replace an EHPad block, but it looks like BranchFolding is actually brave enough to do that.

I'm guessing a better fix would be to block this transform in the right cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154294/new/

https://reviews.llvm.org/D154294



More information about the llvm-commits mailing list