Files
ILSpy/ICSharpCode.Decompiler.Tests
Siegfried Pammer a9a43f96a9 Reverse runtime-async multi-handler try-catch dispatched via an if-chain.
The multi-handler matcher only recognized a switch-instruction dispatch — but
when a try-catch has just two handlers (or a handful with non-consecutive K
values), Roslyn emits an if-chain instead:

  if (num == K_1) br case_K_1; br nextBlock
  ; nextBlock { if (num == K_2) br case_K_2; <leave outer | br end> }

Add a parallel matcher that walks the if-chain and collects (K, case-block)
pairs the same way MatchSwitchDispatch does, plus the terminating leave/branch
as the default exit. Call it as a fallback when the switch matcher rejects.

Also clone the default-exit before re-adding it to the continuation block —
in the if-chain shape it's a child of a *different* block (a later step in
the chain), not the now-cleared switch instruction, so the in-place re-add
relied on the switch's release cascade and didn't generalize.

Closes Cluster 2 from #3745.
2026-05-20 22:30:42 +02:00
..
2026-03-21 20:59:56 +01:00
2025-12-21 13:47:18 +01:00
2025-12-29 19:24:31 +01:00
2025-12-29 19:24:31 +01:00
2025-12-29 19:24:31 +01:00
2026-05-20 21:49:15 +02:00