aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-07-16 01:50:32 +0300
committerVeikka Tuominen <git@vexu.eu>2022-07-23 15:40:11 +0300
commit4d20d6874c418f596c576cea48985de6ef3a3dd2 (patch)
treedbae7fa6ce09114fe95bb7148b54bca9ac9ec2fb /src
parent72c60acd5dd9172c648cb3c5a4b51224ebea33f2 (diff)
downloadzig-4d20d6874c418f596c576cea48985de6ef3a3dd2.tar.gz
zig-4d20d6874c418f596c576cea48985de6ef3a3dd2.zip
move passing safety tests to stage2
Diffstat (limited to 'src')
-rw-r--r--src/AstGen.zig3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig
index af0fac04f1..a0ba743c4e 100644
--- a/src/AstGen.zig
+++ b/src/AstGen.zig
@@ -6504,8 +6504,7 @@ fn ret(gz: *GenZir, scope: *Scope, node: Ast.Node.Index) InnerError!Zir.Inst.Ref
},
.always => {
// Value is always an error. Emit both error defers and regular defers.
- const result = if (rl == .ptr) try gz.addUnNode(.load, rl.ptr, node) else operand;
- const err_code = try gz.addUnNode(.err_union_code, result, node);
+ const err_code = if (rl == .ptr) try gz.addUnNode(.load, rl.ptr, node) else operand;
try genDefers(gz, defer_outer, scope, .{ .both = err_code });
try gz.addRet(rl, operand, node);
return Zir.Inst.Ref.unreachable_value;