| ... | @@ -961,6 +961,13 @@ static Error type_val_resolve_zero_bits(CodeGen *g, ConstExprValue *type_val, Zi | ... | @@ -961,6 +961,13 @@ static Error type_val_resolve_zero_bits(CodeGen *g, ConstExprValue *type_val, Zi |
| 961 | Error err; | 961 | Error err; |
| 962 | if (type_val->special != ConstValSpecialLazy) { | 962 | if (type_val->special != ConstValSpecialLazy) { |
| 963 | assert(type_val->special == ConstValSpecialStatic); | 963 | assert(type_val->special == ConstValSpecialStatic); |
| | 964 | if (type_val->data.x_type->id == ZigTypeIdStruct && |
| | 965 | type_val->data.x_type->data.structure.resolve_loop_flag_zero_bits) |
| | 966 | { |
| | 967 | // Does a struct which contains a pointer field to itself have bits? Yes. |
| | 968 | *is_zero_bits = false; |
| | 969 | return ErrorNone; |
| | 970 | } |
| 964 | if ((err = type_resolve(g, type_val->data.x_type, ResolveStatusZeroBitsKnown))) | 971 | if ((err = type_resolve(g, type_val->data.x_type, ResolveStatusZeroBitsKnown))) |
| 965 | return err; | 972 | return err; |
| 966 | *is_zero_bits = (type_val->data.x_type->abi_size == 0); | 973 | *is_zero_bits = (type_val->data.x_type->abi_size == 0); |