# wasm-link: fix storing decls in the right segment · gitcafe/zig

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

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

Visibility: public

Requested revision: bddf138e7285eefb86ef880e1200a929193da40b

Requested commit: bddf138e7285eefb86ef880e1200a929193da40b

Commit: bddf138e7285eefb86ef880e1200a929193da40b

Tree: 7f5fa11e597ff892801968de310e3b2b95b50c7f

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-link: fix storing decls in the right segment

When a decl is `undefined` is must be stored in the data segment when
the build mode is safe. For unsafe optimize modes, it must be stored
in the bss segment instead.

For mutable decls where the atom contains all zeroes, it must always
be stored in the bss segment. All other values will result in the
atom being stored in the data segment.

```

## Parents

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

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