mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
wasm linker: don't crash on ref to void
This commit is contained in:
parent
e5d78f0b55
commit
d0d0847cd0
@ -4376,7 +4376,8 @@ pub fn navAddr(wasm: *Wasm, nav_index: InternPool.Nav.Index) u32 {
|
||||
assert(wasm.flush_buffer.memory_layout_finished);
|
||||
const comp = wasm.base.comp;
|
||||
assert(comp.config.output_mode != .Obj);
|
||||
const navs_exe_index: NavsExeIndex = @enumFromInt(wasm.navs_exe.getIndex(nav_index).?);
|
||||
// If there is no entry it means the value is zero bits so any address will do.
|
||||
const navs_exe_index: NavsExeIndex = @enumFromInt(wasm.navs_exe.getIndex(nav_index) orelse return 0);
|
||||
log.debug("navAddr {s} {}", .{ navs_exe_index.name(wasm), nav_index });
|
||||
const ds_id: DataSegmentId = .pack(wasm, .{ .nav_exe = navs_exe_index });
|
||||
return wasm.flush_buffer.data_segments.get(ds_id).?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user