# codegen: fix taking the address of a zero-bit field in a zero-bit struct · gitcafe/zig

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

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

Visibility: public

Requested revision: 0e3feebb042a538405153e4bc75a3bb73ee2e63c

Requested commit: 0e3feebb042a538405153e4bc75a3bb73ee2e63c

Commit: 0e3feebb042a538405153e4bc75a3bb73ee2e63c

Tree: d597c19b71254dacb25c7744b03eb5c37d9ee516

Author: Jacob Young

Committer: Jacob Young

## Message

```
codegen: fix taking the address of a zero-bit field in a zero-bit struct

Normally when we want a pointer to the end of a struct we just add 1 to
the struct pointer.  However, when it is a zero-bit struct, the pointer
type being used during lowering is often a dummy pointer type that
actually points to a non-zero-bit type, so we actually want to add 0
instead, since a zero-bit struct begins and ends at the same address.

```

## Parents

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

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