aboutsummaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-07-08 17:33:02 -0700
committerAndrew Kelley <andrew@ziglang.org>2025-07-09 09:32:07 -0700
commitbc2cf0c173465f4e3ac60fe2907dfedd2eebf8eb (patch)
tree7a404dc11967aa7d552f9fd727477257dd49ad03 /src/arch
parentd345a10054caa78d6e697089b0b3ca5b540b2d9c (diff)
downloadzig-bc2cf0c173465f4e3ac60fe2907dfedd2eebf8eb.tar.gz
zig-bc2cf0c173465f4e3ac60fe2907dfedd2eebf8eb.zip
eliminate all uses of std.io.Writer.count except for CBE
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86_64/Encoding.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/arch/x86_64/Encoding.zig b/src/arch/x86_64/Encoding.zig
index 6956b25a3f..9b6f6bac5c 100644
--- a/src/arch/x86_64/Encoding.zig
+++ b/src/arch/x86_64/Encoding.zig
@@ -1016,8 +1016,8 @@ fn estimateInstructionLength(prefix: Prefix, encoding: Encoding, ops: []const Op
// By using a buffer with maximum length of encoded instruction, we can use
// the `end` field of the Writer for the count.
var buf: [16]u8 = undefined;
- var trash = std.io.Writer.discarding(&buf);
- inst.encode(&trash, .{
+ var trash: std.io.Writer.Discarding = .init(&buf);
+ inst.encode(&trash.writer, .{
.allow_frame_locs = true,
.allow_symbols = true,
}) catch {
@@ -1027,7 +1027,7 @@ fn estimateInstructionLength(prefix: Prefix, encoding: Encoding, ops: []const Op
// (`estimateInstructionLength`) has the wrong function signature.
@panic("unexpected failure to encode");
};
- return @intCast(trash.end);
+ return trash.writer.end;
}
const mnemonic_to_encodings_map = init: {