aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 8483c41ae8..c23014f92a 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -5633,6 +5633,13 @@ pub fn analyzeFnBody(mod: *Module, func: *Fn, arena: Allocator) SemaError!Air {
const last_arg_index = inner_block.instructions.items.len;
+ // Save the error trace as our first action in the function.
+ // If this is unnecessary after all, Liveness will clean it up for us.
+ const err_ret_trace_index = try sema.analyzeSaveErrRetIndex(&inner_block);
+ inner_block.error_return_trace_index = err_ret_trace_index;
+ inner_block.error_return_trace_index_on_block_entry = err_ret_trace_index;
+ inner_block.error_return_trace_index_on_function_entry = err_ret_trace_index;
+
sema.analyzeBody(&inner_block, fn_info.body) catch |err| switch (err) {
// TODO make these unreachable instead of @panic
error.NeededSourceLocation => @panic("zig compiler bug: NeededSourceLocation"),