# stage2: fix handling of "prev successful ZIR" · gitcafe/zig

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

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

Visibility: public

Requested revision: 344dc0cc0ffcd32ffb07c43ca7123b8564f2a506

Requested commit: 344dc0cc0ffcd32ffb07c43ca7123b8564f2a506

Commit: 344dc0cc0ffcd32ffb07c43ca7123b8564f2a506

Tree: bbe151e35981f21e26030494422e1958a43afac7

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: fix handling of "prev successful ZIR"

Before this change, the attempt to save the most recent successful ZIR
code only worked in some cases; this reworks the code to be more robust,
thereby fixing a crash when running the stage2 "enums" CBE test cases.

```

## Parents

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

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