authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-15 18:54:23-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-15 18:54:23-04:00
logff7e826b82b097ffb688e809b6d762d8d56c0f3c
tree3ab68d55b317734c32445d69c3ea670b2d266247
parent0b08ae581edb5811d14d86e7c75c23aca59a3a34
signaturelock-open Commit is signed but in an unrecognized format.

fix crash with sometimes type not being resolved


2 files changed, 11 insertions(+), 0 deletions(-)

src/codegen.cpp+4
......@@ -7004,6 +7004,8 @@ static void do_code_gen(CodeGen *g) {
70047004 ZigType *ptr_type = instruction->base.value.type;
70057005 assert(ptr_type->id == ZigTypeIdPointer);
70067006 ZigType *child_type = ptr_type->data.pointer.child_type;
7007 if (type_resolve(g, child_type, ResolveStatusSizeKnown))
7008 zig_unreachable();
70077009 if (!type_has_bits(child_type))
70087010 continue;
70097011 if (instruction->base.ref_count == 0)
......@@ -7015,6 +7017,8 @@ static void do_code_gen(CodeGen *g) {
70157017 continue;
70167018 }
70177019 }
7020 if (type_resolve(g, child_type, ResolveStatusLLVMFull))
7021 zig_unreachable();
70187022 instruction->base.llvm_value = build_alloca(g, child_type, instruction->name_hint,
70197023 get_ptr_align(g, ptr_type));
70207024 }
test/stage1/behavior/async_fn.zig+7
......@@ -734,3 +734,10 @@ test "alignment of local variables in async functions" {
734734 };
735735 S.doTheTest();
736736}
737
738test "no reason to resolve frame still works" {
739 _ = async simpleNothing();
740}
741fn simpleNothing() void {
742 var x: i32 = 1234;
743}