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) {...@@ -7004,6 +7004,8 @@ static void do_code_gen(CodeGen *g) {
7004 ZigType *ptr_type = instruction->base.value.type;7004 ZigType *ptr_type = instruction->base.value.type;
7005 assert(ptr_type->id == ZigTypeIdPointer);7005 assert(ptr_type->id == ZigTypeIdPointer);
7006 ZigType *child_type = ptr_type->data.pointer.child_type;7006 ZigType *child_type = ptr_type->data.pointer.child_type;
7007 if (type_resolve(g, child_type, ResolveStatusSizeKnown))
7008 zig_unreachable();
7007 if (!type_has_bits(child_type))7009 if (!type_has_bits(child_type))
7008 continue;7010 continue;
7009 if (instruction->base.ref_count == 0)7011 if (instruction->base.ref_count == 0)
...@@ -7015,6 +7017,8 @@ static void do_code_gen(CodeGen *g) {...@@ -7015,6 +7017,8 @@ static void do_code_gen(CodeGen *g) {
7015 continue;7017 continue;
7016 }7018 }
7017 }7019 }
7020 if (type_resolve(g, child_type, ResolveStatusLLVMFull))
7021 zig_unreachable();
7018 instruction->base.llvm_value = build_alloca(g, child_type, instruction->name_hint,7022 instruction->base.llvm_value = build_alloca(g, child_type, instruction->name_hint,
7019 get_ptr_align(g, ptr_type));7023 get_ptr_align(g, ptr_type));
7020 }7024 }
test/stage1/behavior/async_fn.zig+7
...@@ -734,3 +734,10 @@ test "alignment of local variables in async functions" {...@@ -734,3 +734,10 @@ test "alignment of local variables in async functions" {
734 };734 };
735 S.doTheTest();735 S.doTheTest();
736}736}
737
738test "no reason to resolve frame still works" {
739 _ = async simpleNothing();
740}
741fn simpleNothing() void {
742 var x: i32 = 1234;
743}