diff options
| author | Luuk de Gram <luuk@degram.dev> | 2023-07-04 20:12:48 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2023-07-08 17:45:05 +0200 |
| commit | d54ebf4356eaeeab4d256d0da4f81678226f81a6 (patch) | |
| tree | 69129636312bc7c8fa02db2ad63f7cbaa74e1959 /lib/std/Build/Step/CheckFile.zig | |
| parent | 836f9fceab03c7de56eba7a9c2e810206e7e8469 (diff) | |
| download | zig-d54ebf4356eaeeab4d256d0da4f81678226f81a6.tar.gz zig-d54ebf4356eaeeab4d256d0da4f81678226f81a6.zip | |
llvm: add safety-check for Wasm memset
When lowering the `memset` instruction, LLVM will lower it to WebAssembly's
`memory.fill` instruction when the bulk-memory feature is enabled. This
instruction will trap when the destination address 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 memset instruction when the length is larger than 0.
Diffstat (limited to 'lib/std/Build/Step/CheckFile.zig')
0 files changed, 0 insertions, 0 deletions
