diff options
| author | Luuk de Gram <luuk@degram.dev> | 2023-05-19 20:14:34 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2023-05-19 20:22:48 +0200 |
| commit | 832330094c00391ecd6f0ea4abf2d05261b5a10c (patch) | |
| tree | e4405f62cb2b698c00504f08059cf7f89cf5291d /src/codegen/spirv | |
| parent | ca870aa00504accd49e7f1d2fceed1e4b8d21100 (diff) | |
| download | zig-832330094c00391ecd6f0ea4abf2d05261b5a10c.tar.gz zig-832330094c00391ecd6f0ea4abf2d05261b5a10c.zip | |
wasm: aggregate_init - ensure zeroed result local
When initializing a packed struct, we must ensure the result local
is zero'd. Previously we would do this by ensuring a new local is
allocated. Although a local is always zero by default, it meant that
if such an initialization was being done inside a loop, it would re-
use that very same local that could potentially still hold a different
value. Because this value is `or`'d with the value, it would result
in a miscompilation. By manually setting this result to 0, we guarantee
the correct behavior.
Diffstat (limited to 'src/codegen/spirv')
0 files changed, 0 insertions, 0 deletions
