This commit is contained in:
gingerBill
2017-10-15 10:14:17 +01:00
parent b3b688fa50
commit 94762b56f6
+3 -2
View File
@@ -664,7 +664,7 @@ 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;
@@ -676,7 +676,8 @@ bool ir_type_has_default_values(Type *t) {
} 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;
} }