authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-12-18 14:53:28-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 15:11:35-08:00
log06303448942c387aa4b9d564bcc918ad27e3940a
tree7abb59be9680354f2f91f6737c0ff8e501d2a6e7
parent416fc2df94ee7a17eb8f133c0814e36e0a358e22

fix calculation of nav alignment


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

src/link/Wasm.zig+9-2
......@@ -1361,13 +1361,20 @@ pub const DataSegment = extern struct {
13611361 const ip = &zcu.intern_pool;
13621362 const ip_index = i.key(wasm).*;
13631363 const ty: ZcuType = .fromInterned(ip.typeOf(ip_index));
1364 return ty.abiAlignment(zcu);
1364 const result = ty.abiAlignment(zcu);
1365 assert(result != .none);
1366 return result;
13651367 },
13661368 inline .nav_exe, .nav_obj => |i| {
13671369 const zcu = wasm.base.comp.zcu.?;
13681370 const ip = &zcu.intern_pool;
13691371 const nav = ip.getNav(i.key(wasm).*);
1370 return nav.status.resolved.alignment;
1372 const explicit = nav.status.resolved.alignment;
1373 if (explicit != .none) return explicit;
1374 const ty: ZcuType = .fromInterned(nav.typeOf(ip));
1375 const result = ty.abiAlignment(zcu);
1376 assert(result != .none);
1377 return result;
13711378 },
13721379 };
13731380 }