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.
d54ebf4356Luuk de Gram committed on 7/8/2023, 3:45:05 PMparent836f9fc
1 file changedLine totals unavailable