# stage1: Fix ICE when generating struct fields with padding · gitcafe/zig

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

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

Visibility: public

Requested revision: 58c2bec589d6d90db31744430407bc88695b5161

Requested commit: 58c2bec589d6d90db31744430407bc88695b5161

Commit: 58c2bec589d6d90db31744430407bc88695b5161

Tree: 7105980173ee3114ac008590eec48362afe62afe

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
stage1: Fix ICE when generating struct fields with padding

Make gen_const_ptr_struct_recursive aware of the possible presence of
some trailing padding by always bitcasting the pointer to its expected
type.

Not an elegant solution but makes LLVM happy and is consistent with how
the other callsites are handling this case.

Fixes #5398

```

## Parents

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

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