authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-08-24 08:48:42+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-08-24 20:42:40+01:00
logedf18aa383cc5553a51e57954cf7e076c4b745db
tree4f962cdd03962ebc0784ee0870b52d909b20f47e
parentdce4edf4d03c1e2b7b4110ea51c09d1a14db2982
signaturelock-open Commit is signed but in an unrecognized format.

Elf2: do not assume nodes are initialized to zero

This is not a guarantee of the `MappedFile` interface, because guaranteeing it can be inefficient. Right now it will usually be the case, but that may not hold in the future.

1 files changed, 2 insertions(+), 2 deletions(-)

src/link/Elf2.zig+2-2
......@@ -4249,8 +4249,8 @@ fn initHeaders(
42494249 if (elf.targetEndian() != std.lang.Endian.native) {
42504250 std.mem.byteSwapAllFields(info.Header(), header);
42514251 }
4252 // The initial bucket and chain values are all 0, but `MappedFile` initialized
4253 // the node with zeroes anyway, so no need to memset.
4252 // The initial bucket and chain values are all 0.
4253 @memset(hash_slice[@sizeOf(info.Header())..], 0);
42544254 },
42554255 }
42564256