# fix overflow found while fuzzing · gitcafe/zig

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

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

Visibility: public

Requested revision: 581d292381157464ae6f2c88c8a628314f005742

Requested commit: 581d292381157464ae6f2c88c8a628314f005742

Commit: 581d292381157464ae6f2c88c8a628314f005742

Tree: 1d67f07416fb6d45e54267e459ebda5c7581e1d0

Author: travisstaloch

Committer: GitHub

## Message

```
fix overflow found while fuzzing

* allow file level `union {}` to parse as tuple field

this was found while fuzzing zls.

* before this patch the input `union {}` crashed the parser.  after
  this, it parses correctly just like `struct {}`.
* adds behavior tests for both inputs `struct {}` and `union {}`,
  checking that each becomes a file level tuple field.
```

## Parents

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

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