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

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

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

Visibility: public

Requested revision: 24d4bfb666cff9617687c1d5a2b22395c51a000e

Requested commit: 24d4bfb666cff9617687c1d5a2b22395c51a000e

Commit: 24d4bfb666cff9617687c1d5a2b22395c51a000e

Tree: 84c2852b38464bff57b56bcef297e57d67f29a6b

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

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

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