mirror of
https://github.com/ziglang/zig.git
synced 2026-01-30 19:23:37 +00:00
fix regression with simple pointer to self
This commit is contained in:
parent
ac4dd9d665
commit
f0034495fa
@ -961,6 +961,13 @@ static Error type_val_resolve_zero_bits(CodeGen *g, ConstExprValue *type_val, Zi
|
||||
Error err;
|
||||
if (type_val->special != ConstValSpecialLazy) {
|
||||
assert(type_val->special == ConstValSpecialStatic);
|
||||
if (type_val->data.x_type->id == ZigTypeIdStruct &&
|
||||
type_val->data.x_type->data.structure.resolve_loop_flag_zero_bits)
|
||||
{
|
||||
// Does a struct which contains a pointer field to itself have bits? Yes.
|
||||
*is_zero_bits = false;
|
||||
return ErrorNone;
|
||||
}
|
||||
if ((err = type_resolve(g, type_val->data.x_type, ResolveStatusZeroBitsKnown)))
|
||||
return err;
|
||||
*is_zero_bits = (type_val->data.x_type->abi_size == 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user