Skip to content

Commit 26c93f4

Browse files
committed
fix missing missing entry symbol error when no zcu
1 parent a00d913 commit 26c93f4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/link/Wasm/Flush.zig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {
6969
const is_obj = comp.config.output_mode == .Obj;
7070
const allow_undefined = is_obj or wasm.import_symbols;
7171

72+
const entry_name = if (wasm.entry_resolution.isNavOrUnresolved(wasm)) wasm.entry_name else .none;
73+
7274
if (comp.zcu) |zcu| {
7375
const ip: *const InternPool = &zcu.intern_pool; // No mutations allowed!
7476

@@ -88,8 +90,6 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {
8890
}
8991
}
9092

91-
const entry_name = if (wasm.entry_resolution.isNavOrUnresolved(wasm)) wasm.entry_name else .none;
92-
9393
for (wasm.nav_exports.keys()) |*nav_export| {
9494
if (ip.isFunctionType(ip.getNav(nav_export.nav_index).typeOf(ip))) {
9595
log.debug("flush export '{s}' nav={d}", .{ nav_export.name.slice(wasm), nav_export.nav_index });
@@ -115,13 +115,13 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {
115115
for (f.missing_exports.keys()) |exp_name| {
116116
diags.addError("manually specified export name '{s}' undefined", .{exp_name.slice(wasm)});
117117
}
118+
}
118119

119-
if (entry_name.unwrap()) |name| {
120-
if (wasm.entry_resolution == .unresolved) {
121-
var err = try diags.addErrorWithNotes(1);
122-
try err.addMsg("entry symbol '{s}' missing", .{name.slice(wasm)});
123-
err.addNote("'-fno-entry' suppresses this error", .{});
124-
}
120+
if (entry_name.unwrap()) |name| {
121+
if (wasm.entry_resolution == .unresolved) {
122+
var err = try diags.addErrorWithNotes(1);
123+
try err.addMsg("entry symbol '{s}' missing", .{name.slice(wasm)});
124+
err.addNote("'-fno-entry' suppresses this error", .{});
125125
}
126126
}
127127

0 commit comments

Comments
 (0)