mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Fix issue #122
This commit is contained in:
+13
-12
@@ -664,19 +664,20 @@ bool ir_type_has_default_values(Type *t) {
|
|||||||
return ir_type_has_default_values(t->Array.elem);
|
return ir_type_has_default_values(t->Array.elem);
|
||||||
|
|
||||||
case Type_Struct:
|
case Type_Struct:
|
||||||
if (!t->Struct.is_raw_union) {
|
if (t->Struct.is_raw_union) return false;
|
||||||
for_array(i, t->Struct.fields) {
|
for_array(i, t->Struct.fields) {
|
||||||
Entity *f = t->Struct.fields_in_src_order[i];
|
Entity *f = t->Struct.fields_in_src_order[i];
|
||||||
if (f->kind != Entity_Variable) continue;
|
if (f->kind != Entity_Variable) continue;
|
||||||
if (f->Variable.default_is_nil) {
|
if (f->Variable.default_is_nil) {
|
||||||
// NOTE(bill): This is technically zero
|
// NOTE(bill): This is technically zero
|
||||||
continue;
|
continue;
|
||||||
} else if (f->Variable.default_value.kind != ExactValue_Invalid) {
|
} else if (f->Variable.default_value.kind != ExactValue_Invalid) {
|
||||||
return true;
|
return true;
|
||||||
} else if (f->Variable.default_is_undef) {
|
} else if (f->Variable.default_is_undef) {
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
bool sub = ir_type_has_default_values(f->type);
|
||||||
|
if (sub) return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user