From d367f78a777122c152c7b23539ac80fb4f7f11c8 Mon Sep 17 00:00:00 2001 From: Nexxii Date: Tue, 1 Sep 2026 23:53:33 +0200 Subject: [PATCH] include file path in invalid bytecode error --- src/main.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index 40d6b158..7a29a762 100644 --- a/src/main.zig +++ b/src/main.zig @@ -459,7 +459,11 @@ fn runFile(allocator: std.mem.Allocator, path: []const u8, script_args: []const fn runBytecode(allocator: std.mem.Allocator, bc: []const u8, path: []const u8, script_args: []const []const u8) !void { var result = bytecode_format.deserialize(allocator, bc) catch { - try writeStderr("error: invalid bytecode file\n"); + var buf: [std.fs.max_path_bytes + 64]u8 = undefined; + const msg = std.fmt.bufPrint(&buf, "error: invalid bytecode file '{s}'\n", .{path}) catch + "error: invalid bytecode file\n"; + + try writeStderr(msg); std.process.exit(1); }; defer result.deinit();