# LLVM: fix missing alignment on wrapping instructions · gitcafe/zig

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

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

Visibility: public

Requested revision: d2ad8afff4c404f6e1a566cce3fa6e7f768503e5

Requested commit: d2ad8afff4c404f6e1a566cce3fa6e7f768503e5

Commit: d2ad8afff4c404f6e1a566cce3fa6e7f768503e5

Tree: 28ca64fb5e60cf15fdff8a4c6be921c83b7ce8b1

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
LLVM: fix missing alignment on wrapping instructions

Previously, when lowering AIR instructions `wrap_errunion_payload`,
`wrap_errunion_err`, and `wrap_optional`, the LLVM backend would create
an alloca instruction to store the result, but did not set the alignment
on it. This caused UB which went undetected for a long time until we
started enabling the stack protector.

Closes #12594
Unblocks #12508
Inspires #12634

Tests passed locally:
 * test-behavior
 * test-cases

```

## Parents

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

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