# stage2: LLVM codegen of arrays should use type length, not value length · gitcafe/zig

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

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

Visibility: public

Requested revision: a859f94644cb362d84d3f9d72bc02b00a75fc32a

Requested commit: a859f94644cb362d84d3f9d72bc02b00a75fc32a

Commit: a859f94644cb362d84d3f9d72bc02b00a75fc32a

Tree: e3f4d09b74fb4bca327b192d311bb5bbe950d161

Author: Mitchell Hashimoto

Committer: Mitchell Hashimoto

## Message

```
stage2: LLVM codegen of arrays should use type length, not value length

It is possible for the value length to be longer than the type because
we allow in-memory coercing of types such as `[5:0]u8` to `[5]u8`. In
such a case, the value length is 6 but the type length if 5.

The `.repeated` value type already got this right, so this is extending
similar logic out to `.aggregate` and `.bytes`. Both scenarios are
tested in behavior tests.

Fixes #11165

```

## Parents

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

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