Skip to content

Commit

Permalink
Driver: don't catch fatal errors; let caller handle them
Browse files Browse the repository at this point in the history
  • Loading branch information
ehaas authored and Vexu committed Dec 2, 2024
1 parent 56cb741 commit d80080e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/aro/Driver.zig
Original file line number Diff line number Diff line change
Expand Up @@ -723,13 +723,7 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_
error.StreamTooLong => return d.fatal("builtin macro source exceeded max size", .{}),
else => |e| return e,
};
d.processSource(tc, d.inputs.items[0], builtin, user_macros, fast_exit, asm_gen_fn) catch |e| switch (e) {
error.FatalError => {
d.renderErrors();
d.exitWithCleanup(1);
},
else => |er| return er,
};
try d.processSource(tc, d.inputs.items[0], builtin, user_macros, fast_exit, asm_gen_fn);
unreachable;
}

Expand All @@ -738,12 +732,7 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_
error.StreamTooLong => return d.fatal("builtin macro source exceeded max size", .{}),
else => |e| return e,
};
d.processSource(tc, source, builtin, user_macros, fast_exit, asm_gen_fn) catch |e| switch (e) {
error.FatalError => {
d.renderErrors();
},
else => |er| return er,
};
try d.processSource(tc, source, builtin, user_macros, fast_exit, asm_gen_fn);
}
if (d.comp.diagnostics.errors != 0) {
if (fast_exit) d.exitWithCleanup(1);
Expand Down

0 comments on commit d80080e

Please sign in to comment.