# AstGen: fix if, orelse, catch, with unreachable bodies · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/61a53a587558ff1fe1b0ec98bb424022885edccf)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 61a53a587558ff1fe1b0ec98bb424022885edccf

Requested commit: 61a53a587558ff1fe1b0ec98bb424022885edccf

Commit: 61a53a587558ff1fe1b0ec98bb424022885edccf

Tree: 0e0ad82f7998a473104ec6fa07cb051a1b56a7c3

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
AstGen: fix if, orelse, catch, with unreachable bodies

Before, the system to replace a result location pointer with a
traditional break instruction did not notice the case when one of the
bodies was unreachable. Now, the emitted ZIR code is improved and
simplified in this case, resulting in a new passing behavior test.

```

## Parents

- [ac52e005640e9dc7829356f857a82b0bc3894245](https://git.cafe/gitcafe/zig/commit/ac52e005640e9dc7829356f857a82b0bc3894245?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/61a53a587558ff1fe1b0ec98bb424022885edccf?format=markdown)
