Skip to content

Commit

Permalink
make solution less arbitary
Browse files Browse the repository at this point in the history
Revert "make solution less arbitary"

This reverts commit 29cfce3.

df

df
  • Loading branch information
mary-georgiou-sonarsource committed Jul 19, 2024
1 parent f10c649 commit ff769a1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void BuildBranches(BasicBlock block)
if (block.EnclosingNonLocalLifetimeRegion() is { Kind: ControlFlowRegionKind.Try } tryRegion)
{
var catchesAll = false;
foreach (var catchOrFilterRegion in block.Successors.Union(Cfg.Blocks[tryRegion.LastBlockOrdinal].Successors).SelectMany(CatchOrFilterRegions))
foreach (var catchOrFilterRegion in tryRegion.Blocks(Cfg).Where(x => x.Ordinal >= block.Ordinal).SelectMany(x => x.Successors).SelectMany(CatchOrFilterRegions))
{
var catchOrFilterBlock = Cfg.Blocks[catchOrFilterRegion.FirstBlockOrdinal];
AddBranch(block, catchOrFilterBlock);
Expand Down

0 comments on commit ff769a1

Please sign in to comment.