mirror of
https://github.com/ziglang/zig.git
synced 2025-12-07 06:43:07 +00:00
fix crash with sometimes type not being resolved
This commit is contained in:
parent
0b08ae581e
commit
ff7e826b82
@ -7004,6 +7004,8 @@ static void do_code_gen(CodeGen *g) {
|
|||||||
ZigType *ptr_type = instruction->base.value.type;
|
ZigType *ptr_type = instruction->base.value.type;
|
||||||
assert(ptr_type->id == ZigTypeIdPointer);
|
assert(ptr_type->id == ZigTypeIdPointer);
|
||||||
ZigType *child_type = ptr_type->data.pointer.child_type;
|
ZigType *child_type = ptr_type->data.pointer.child_type;
|
||||||
|
if (type_resolve(g, child_type, ResolveStatusSizeKnown))
|
||||||
|
zig_unreachable();
|
||||||
if (!type_has_bits(child_type))
|
if (!type_has_bits(child_type))
|
||||||
continue;
|
continue;
|
||||||
if (instruction->base.ref_count == 0)
|
if (instruction->base.ref_count == 0)
|
||||||
@ -7015,6 +7017,8 @@ static void do_code_gen(CodeGen *g) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (type_resolve(g, child_type, ResolveStatusLLVMFull))
|
||||||
|
zig_unreachable();
|
||||||
instruction->base.llvm_value = build_alloca(g, child_type, instruction->name_hint,
|
instruction->base.llvm_value = build_alloca(g, child_type, instruction->name_hint,
|
||||||
get_ptr_align(g, ptr_type));
|
get_ptr_align(g, ptr_type));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -734,3 +734,10 @@ test "alignment of local variables in async functions" {
|
|||||||
};
|
};
|
||||||
S.doTheTest();
|
S.doTheTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "no reason to resolve frame still works" {
|
||||||
|
_ = async simpleNothing();
|
||||||
|
}
|
||||||
|
fn simpleNothing() void {
|
||||||
|
var x: i32 = 1234;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user