Skip to content

Commit 66b89c2

Browse files
committed
don't show struct size and alignment if invalid
1 parent efe8d3b commit 66b89c2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vdc/dmdserver/semvisitor.d

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,8 +1284,15 @@ bool showSizeAndAlignment = false;
12841284
string tipSizeAndAlignment(Type t)
12851285
{
12861286
if (auto cd = t.isClassHandle())
1287+
{
1288+
if (cd.sizeok != Sizeok.done)
1289+
return "";
12871290
return "Size: " ~ to!string(cd.structsize) ~ ", Alignment: " ~ to!string(cd.alignsize);
1288-
return "Size: " ~ to!string(t.size()) ~ ", Alignment: " ~ to!string(t.alignsize());
1291+
}
1292+
auto sz = t.size();
1293+
if (sz == SIZE_INVALID)
1294+
return "";
1295+
return "Size: " ~ to!string(sz) ~ ", Alignment: " ~ to!string(t.alignsize());
12891296
}
12901297

12911298
TipData tipForType(Type t)

0 commit comments

Comments
 (0)