aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-03-21 19:07:20 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-03-21 19:08:30 -0700
commit0fb005d1d05acb680389ce8be51bab6020309922 (patch)
treebb6bd3fe4ec2cabc09768f3c44205cbcdd8c9725 /src
parentbe579d479753153e78e55b17cb8fd2d55004145b (diff)
downloadzig-0fb005d1d05acb680389ce8be51bab6020309922.tar.gz
zig-0fb005d1d05acb680389ce8be51bab6020309922.zip
Sema: dummy implementation of `@errorReturnTrace`
Also update std/build.zig to use stage2 function pointer semantics. This gets us a little bit closer to `zig build` working, although it is now hitting a new crash in the compiler.
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 208f33cf7c..61c46bcce7 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -12439,7 +12439,11 @@ fn zirErrorReturnTrace(
extended: Zir.Inst.Extended.InstData,
) CompileError!Air.Inst.Ref {
const src: LazySrcLoc = .{ .node_offset = @bitCast(i32, extended.operand) };
- return sema.fail(block, src, "TODO: Sema.zirErrorReturnTrace", .{});
+ const unresolved_stack_trace_ty = try sema.getBuiltinType(block, src, "StackTrace");
+ const stack_trace_ty = try sema.resolveTypeFields(block, src, unresolved_stack_trace_ty);
+ const opt_stack_trace_ty = try Type.optional(sema.arena, stack_trace_ty);
+ // https://github.com/ziglang/zig/issues/11259
+ return sema.addConstant(opt_stack_trace_ty, Value.@"null");
}
fn zirFrame(