aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorMatthew Lugg <mlugg@mlugg.co.uk>2024-12-25 02:58:27 +0000
committerGitHub <noreply@github.com>2024-12-25 02:58:27 +0000
commit497592c9b45a94fb7b6028bf45b80f183e395a9b (patch)
tree467873c408750cb4223f3ccf31775e42ec9fbd5c /src/arch/wasm/CodeGen.zig
parentaf5e731729592af4a5716edd3b1e03264d66ea46 (diff)
parent3afda4322c34dedc2319701fdfac3505c8d311e9 (diff)
downloadzig-497592c9b45a94fb7b6028bf45b80f183e395a9b.tar.gz
zig-497592c9b45a94fb7b6028bf45b80f183e395a9b.zip
Merge pull request #22303 from mlugg/131-new
compiler: analyze type and value of global declarations separately
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index ccdf38a474..49961042bc 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -3218,15 +3218,7 @@ fn lowerNavRef(func: *CodeGen, nav_index: InternPool.Nav.Index, offset: u32) Inn
const zcu = pt.zcu;
const ip = &zcu.intern_pool;
- // check if decl is an alias to a function, in which case we
- // want to lower the actual decl, rather than the alias itself.
- const owner_nav = switch (ip.indexToKey(zcu.navValue(nav_index).toIntern())) {
- .func => |function| function.owner_nav,
- .variable => |variable| variable.owner_nav,
- .@"extern" => |@"extern"| @"extern".owner_nav,
- else => nav_index,
- };
- const nav_ty = ip.getNav(owner_nav).typeOf(ip);
+ const nav_ty = ip.getNav(nav_index).typeOf(ip);
if (!ip.isFunctionType(nav_ty) and !Type.fromInterned(nav_ty).hasRuntimeBitsIgnoreComptime(zcu)) {
return .{ .imm32 = 0xaaaaaaaa };
}