| ... | @@ -1707,7 +1707,10 @@ fn buildOutputType( | ... | @@ -1707,7 +1707,10 @@ fn buildOutputType( |
| 1707 | } | 1707 | } |
| 1708 | }; | 1708 | }; |
| 1709 | | 1709 | |
| 1710 | try updateModule(gpa, comp, zir_out_path, hook); | 1710 | updateModule(gpa, comp, zir_out_path, hook) catch |err| switch (err) { |
| | 1711 | error.SemanticAnalyzeFail => process.exit(1), |
| | 1712 | else => |e| return e, |
| | 1713 | }; |
| 1711 | | 1714 | |
| 1712 | if (build_options.is_stage1 and comp.stage1_lock != null and watch) { | 1715 | if (build_options.is_stage1 and comp.stage1_lock != null and watch) { |
| 1713 | warn("--watch is not recommended with the stage1 backend; it leaks memory and is not capable of incremental compilation", .{}); | 1716 | warn("--watch is not recommended with the stage1 backend; it leaks memory and is not capable of incremental compilation", .{}); |
| ... | @@ -1819,7 +1822,10 @@ fn buildOutputType( | ... | @@ -1819,7 +1822,10 @@ fn buildOutputType( |
| 1819 | if (output_mode == .Exe) { | 1822 | if (output_mode == .Exe) { |
| 1820 | try comp.makeBinFileWritable(); | 1823 | try comp.makeBinFileWritable(); |
| 1821 | } | 1824 | } |
| 1822 | try updateModule(gpa, comp, zir_out_path, hook); | 1825 | updateModule(gpa, comp, zir_out_path, hook) catch |err| switch (err) { |
| | 1826 | error.SemanticAnalyzeFail => continue, |
| | 1827 | else => |e| return e, |
| | 1828 | }; |
| 1823 | } else if (mem.eql(u8, actual_line, "exit")) { | 1829 | } else if (mem.eql(u8, actual_line, "exit")) { |
| 1824 | break; | 1830 | break; |
| 1825 | } else if (mem.eql(u8, actual_line, "help")) { | 1831 | } else if (mem.eql(u8, actual_line, "help")) { |
| ... | @@ -1849,6 +1855,7 @@ fn updateModule(gpa: *Allocator, comp: *Compilation, zir_out_path: ?[]const u8, | ... | @@ -1849,6 +1855,7 @@ fn updateModule(gpa: *Allocator, comp: *Compilation, zir_out_path: ?[]const u8, |
| 1849 | for (errors.list) |full_err_msg| { | 1855 | for (errors.list) |full_err_msg| { |
| 1850 | full_err_msg.renderToStdErr(); | 1856 | full_err_msg.renderToStdErr(); |
| 1851 | } | 1857 | } |
| | 1858 | return error.SemanticAnalyzeFail; |
| 1852 | } else switch (hook) { | 1859 | } else switch (hook) { |
| 1853 | .none => {}, | 1860 | .none => {}, |
| 1854 | .print => |bin_path| try io.getStdOut().writer().print("{s}\n", .{bin_path}), | 1861 | .print => |bin_path| try io.getStdOut().writer().print("{s}\n", .{bin_path}), |