[PATCH] D38223: Make sure the basic block has an insertion point before dereferencing it

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 10:10:06 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D38223#888141, @marco-c wrote:

> > I think any invoke or cleanupret that unwinds to a catchswitch needs to look through the successors of the catchswitch. The unwind edge may be another catchswitch, which we must also look through. We should add all the non-catchswitch successors to ComplexEdgeSuccs.
>
> The current patch is achieving this, no? All successors from all basic blocks are stored in ComplexEdgeSuccs, but then catchswitchs are skipped.


Almost. I think what's missing is that single successor catchswitches should hit the `else` case instead of continuing the first loop. Also, notice how `Edge` indexes into a global array of length `Edges`. When you continue the loop, some of the slots in that array go unused. Maybe that's OK, but it seems like a bug. Sending catchswitch through the `else` case instead of continuing should fix that.


Repository:
  rL LLVM

https://reviews.llvm.org/D38223





More information about the llvm-commits mailing list