# stage1: Don't ask LLVM to emit misaligned memcpy · gitcafe/zig

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

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

Visibility: public

Requested revision: f78380b936de862476ea6b3cc3e8d4ba4562c7fa

Requested commit: f78380b936de862476ea6b3cc3e8d4ba4562c7fa

Commit: f78380b936de862476ea6b3cc3e8d4ba4562c7fa

Tree: 3c4280298a9005d320b8a2dcddb157f3e261cf1d

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
stage1: Don't ask LLVM to emit misaligned memcpy

Pay close attention to the RHS type alignment when rendering an
assignment op as it may differ from the LHS pointer one.

This problem was noticed when debugging a CI failure in #6648: due to
sheer luck the misalignment caused a segfault on macos that was also
reproduced locally.

I tried to write a small test case but it turned out to be a daunting
task as I couldn't manage to trigger the problem consistently (and stop
the optimizer from simplifying everything). Patches welcome.

```

## Parents

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

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