Skip to content

Commit

Permalink
JIT: fix up switch map for out-of-loop predecessor (#64014)
Browse files Browse the repository at this point in the history
If we have a loop where some of the non-loop predecessors are switchs, and
we add pre-header to the loop, we need to update the switch map for those
predecessors.

Fixes #63982.
  • Loading branch information
AndyAyersMS authored Jan 20, 2022
1 parent 7f828a7 commit a618086
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/coreclr/jit/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7572,6 +7572,8 @@ void Compiler::fgCreateLoopPreHeader(unsigned lnum)
fgAddRefPred(preHead, predBlock);
}
} while (++jumpTab, --jumpCnt);

UpdateSwitchTableTarget(predBlock, entry, preHead);
break;

default:
Expand Down

0 comments on commit a618086

Please sign in to comment.