aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/CheckObject.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2023-07-03 20:08:13 +0200
committerLuuk de Gram <luuk@degram.dev>2023-07-08 17:45:04 +0200
commit836f9fceab03c7de56eba7a9c2e810206e7e8469 (patch)
tree216e3c7486d9c2f3aae0ab14848ad1c0cf94201e /lib/std/Build/Step/CheckObject.zig
parent89396ff02ba235592641fb388e3958c2c047e728 (diff)
downloadzig-836f9fceab03c7de56eba7a9c2e810206e7e8469.tar.gz
zig-836f9fceab03c7de56eba7a9c2e810206e7e8469.zip
llvm: add safety-check for Wasm memcpy
When lowering the `memcpy` instruction, LLVM will lower it to WebAssembly's `memory.copy` instruction when the bulk-memory feature is enabled. This instruction will trap when the destination or source pointer is out-of-bounds. By Zig's semantics, it is valid to have an invalid pointer when the length is 0. To prevent runtimes from trapping, we add a safety-check for slices to only lower to a memcpy instruction when the length is larger than 0.
Diffstat (limited to 'lib/std/Build/Step/CheckObject.zig')
0 files changed, 0 insertions, 0 deletions