Recursively checking for incomplete/unknown-sized types.

This commit is contained in:
acqn
2020-08-30 02:30:43 +08:00
committed by Oliver Schmidt
parent 8541f18340
commit f1161daee9

View File

@@ -979,7 +979,7 @@ int IsClassIncomplete (const Type* T)
/* Return true if this is an object type lacking size info */ /* Return true if this is an object type lacking size info */
{ {
if (IsTypeArray (T)) { if (IsTypeArray (T)) {
return GetElementCount (T) == UNSPECIFIED; return GetElementCount (T) == UNSPECIFIED || IsClassIncomplete (T + 1);
} }
return IsTypeVoid (T) || IsIncompleteESUType (T); return IsTypeVoid (T) || IsIncompleteESUType (T);
} }
@@ -1072,7 +1072,7 @@ int HasUnknownSize (const Type* T)
/* Return true if this is an incomplete ESU type or an array of unknown size */ /* Return true if this is an incomplete ESU type or an array of unknown size */
{ {
if (IsTypeArray (T)) { if (IsTypeArray (T)) {
return GetElementCount (T) == UNSPECIFIED; return GetElementCount (T) == UNSPECIFIED || HasUnknownSize (T + 1);
} }
return IsIncompleteESUType (T); return IsIncompleteESUType (T);
} }