From f1161daee91890aeb4f028fe81637a4bf73079f3 Mon Sep 17 00:00:00 2001 From: acqn Date: Sun, 30 Aug 2020 02:30:43 +0800 Subject: [PATCH] Recursively checking for incomplete/unknown-sized types. --- src/cc65/datatype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc65/datatype.c b/src/cc65/datatype.c index 522b653c6..c5fb784a2 100644 --- a/src/cc65/datatype.c +++ b/src/cc65/datatype.c @@ -979,7 +979,7 @@ int IsClassIncomplete (const Type* T) /* Return true if this is an object type lacking size info */ { if (IsTypeArray (T)) { - return GetElementCount (T) == UNSPECIFIED; + return GetElementCount (T) == UNSPECIFIED || IsClassIncomplete (T + 1); } 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 */ { if (IsTypeArray (T)) { - return GetElementCount (T) == UNSPECIFIED; + return GetElementCount (T) == UNSPECIFIED || HasUnknownSize (T + 1); } return IsIncompleteESUType (T); }