diff options
| author | travisstaloch <twostepted@gmail.com> | 2022-12-23 13:10:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-23 23:10:04 +0200 |
| commit | 581d292381157464ae6f2c88c8a628314f005742 (patch) | |
| tree | 1d67f07416fb6d45e54267e459ebda5c7581e1d0 /test/behavior/empty_file_level_struct.zig | |
| parent | bb62d5105ca02a8b1c959ccf79b9f2861505a150 (diff) | |
| download | zig-581d292381157464ae6f2c88c8a628314f005742.tar.gz zig-581d292381157464ae6f2c88c8a628314f005742.zip | |
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.
Diffstat (limited to 'test/behavior/empty_file_level_struct.zig')
| -rw-r--r-- | test/behavior/empty_file_level_struct.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/behavior/empty_file_level_struct.zig b/test/behavior/empty_file_level_struct.zig new file mode 100644 index 0000000000..86f0f2b3c7 --- /dev/null +++ b/test/behavior/empty_file_level_struct.zig @@ -0,0 +1 @@ +struct {} |
