[WebAssembly] memcpy
does not result in no-op for zero-length slices
#16360
Labels
arch-wasm
32-bit and 64-bit WebAssembly
backend-llvm
The LLVM backend outputs an LLVM IR Module.
optimization
upstream
An issue with a third party project that Zig uses.
Milestone
Zig Version
0.11.0-dev.3947+89396ff02
Steps to Reproduce and Observed Behavior
Given the following program and CLI input:
results in a program that traps:
This is due to Wasm's
memory.copy
instruction trapping when the source -or destination address is out-of-bounds regardless of the length operand.Expected Behavior
I expected zero-length memset/memcpy to result in a no-op and not trap.
The text was updated successfully, but these errors were encountered: