zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit d577dde636173e5ec799e67ead32722ac59148db (tree)
parent 9780fd59f063d23e69ceadf4305453531b704c11
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue,  2 Apr 2019 18:11:53 -0400

passing all tests

Diffstat:
Msrc/analyze.cpp | 4++--
Msrc/codegen.cpp | 3+++
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/analyze.cpp b/src/analyze.cpp @@ -1731,7 +1731,7 @@ static Error resolve_union_alignment(CodeGen *g, ZigType *union_type) { union_type->data.unionation.reported_infinite_err = true; union_type->data.unionation.resolve_status = ResolveStatusInvalid; ErrorMsg *msg = add_node_error(g, decl_node, - buf_sprintf("union '%s' depends on its own alignment", buf_ptr(&union_type->name))); + buf_sprintf("union '%s' contains itself", buf_ptr(&union_type->name))); emit_error_notes_for_ref_stack(g, msg); } return ErrorSemanticAnalyzeFail; @@ -2225,7 +2225,7 @@ static Error resolve_struct_alignment(CodeGen *g, ZigType *struct_type) { if (struct_type->data.structure.resolve_status != ResolveStatusInvalid) { struct_type->data.structure.resolve_status = ResolveStatusInvalid; ErrorMsg *msg = add_node_error(g, decl_node, - buf_sprintf("struct '%s' depends on its own alignment", buf_ptr(&struct_type->name))); + buf_sprintf("struct '%s' contains itself", buf_ptr(&struct_type->name))); emit_error_notes_for_ref_stack(g, msg); } return ErrorSemanticAnalyzeFail; diff --git a/src/codegen.cpp b/src/codegen.cpp @@ -6737,6 +6737,9 @@ static void do_code_gen(CodeGen *g) { if (have_err_ret_trace_stack) { ZigType *array_type = get_array_type(g, g->builtin_types.entry_usize, stack_trace_ptr_count); err_ret_array_val = build_alloca(g, array_type, "error_return_trace_addresses", get_abi_alignment(g, array_type)); + + // populate g->stack_trace_type + (void)get_ptr_to_stack_trace_type(g); g->cur_err_ret_trace_val_stack = build_alloca(g, g->stack_trace_type, "error_return_trace", get_abi_alignment(g, g->stack_trace_type)); } else { g->cur_err_ret_trace_val_stack = nullptr;