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 {...@@ -1361,13 +1361,20 @@ pub const DataSegment = extern struct {
1361 const ip = &zcu.intern_pool;1361 const ip = &zcu.intern_pool;
1362 const ip_index = i.key(wasm).*;1362 const ip_index = i.key(wasm).*;
1363 const ty: ZcuType = .fromInterned(ip.typeOf(ip_index));1363 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;
1365 },1367 },
1366 inline .nav_exe, .nav_obj => |i| {1368 inline .nav_exe, .nav_obj => |i| {
1367 const zcu = wasm.base.comp.zcu.?;1369 const zcu = wasm.base.comp.zcu.?;
1368 const ip = &zcu.intern_pool;1370 const ip = &zcu.intern_pool;
1369 const nav = ip.getNav(i.key(wasm).*);1371 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;
1371 },1378 },
1372 };1379 };
1373 }1380 }