# stage2: fix bug where invalid ZIR was generated · gitcafe/zig

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

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

Visibility: public

Requested revision: a483e38df62f73dc0cdadee6faf3e083094210d4

Requested commit: a483e38df62f73dc0cdadee6faf3e083094210d4

Commit: a483e38df62f73dc0cdadee6faf3e083094210d4

Tree: 3c8625290a8c74acc122f0a0a15e1764c15918fb

Author: Timon Kruiper

Committer: Timon Kruiper

## Message

````
stage2: fix bug where invalid ZIR was generated

The following code caused an assertion to be hit:
```
pub fn main() void {
    var e: anyerror!c_int = error.Foo;
    const i = e catch 69;
    assert(69 - i == 0);
}
```

````

## Parents

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

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