Commit 3edf8c7a6c
Changed files (1)
src
link
src/link/Wasm.zig
@@ -2218,6 +2218,9 @@ pub fn flushModule(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Nod
// We write the magic bytes at the end so they will only be written
// if everything succeeded as expected. So populate with 0's for now.
try binary_writer.writeAll(&[_]u8{0} ** 8);
+ // (Re)set file pointer to 0
+ try wasm.base.file.?.setEndPos(0);
+ try wasm.base.file.?.seekTo(0);
// Type section
if (wasm.func_types.items.len != 0) {