Commit d577dde636

Andrew Kelley <andrew@ziglang.org>
2019-04-03 00:11:53
passing all tests
1 parent 9780fd5
Changed files (2)
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;
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;