gh-92619: Fix bug where the compiler duplicates exit blocks unnecessarily (GH-92620) (GH-92621)

(cherry picked from commit 7c6b7ade8df35355484d3944779fe35dcc560aab)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
3 files changed