bytecodealliance / bytecodealliance/wasmtime
Cranelift: emit_small_memory_copy ignores alignment
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
`cranelift_frontend::FunctionBuilder::emit_small_memory_copy`([documentation](https://docs.rs/cranelift-frontend/0.78.0/cranelift_frontend/struct.FunctionBuilder.html#method.emit_small_memory_copy)) takes the arguments `dest_align` and `src_align`, which it uses only for an assertion and then ignores. It chooses an access size which may be larger than the alignment and calls `flags.set_aligned();` and proceeds to doing unaligned memory access. This seems to be a mistake.
Reported by Veverak at https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/emit_small_memory_copy.20ignores.20alignment/near/263576215
Contributor guide
Assessment
This issue has not been assessed yet.