Mercurial > projects > ldc
diff gen/abi-x86-64.cpp @ 1054:a3d7288c4473
Future-proof the code to classify static array members of structs.
I made sure to create a merge conflict with the code attached to ticket #229
(which comments this code out due to changes in the DMD 'Type' type hierarchy)
so that if it gets committed as-is there will be a human looking at it.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 08 Mar 2009 01:26:30 +0100 |
parents | dc608dc33081 |
children | 40d7f9b7357f |
line wrap: on
line diff
--- a/gen/abi-x86-64.cpp Sun Mar 08 00:57:58 2009 +0100 +++ b/gen/abi-x86-64.cpp Sun Mar 08 01:26:30 2009 +0100 @@ -153,13 +153,14 @@ // the other types that can get bigger than 16 bytes accum.addField(offset, Memory); } else if (ty->ty == Tsarray) { - d_uns64 eltsize = ty->next->size(); + Type* eltType = ty->nextOf(); + d_uns64 eltsize = eltType->size(); if (eltsize > 0) { d_uns64 dim = ty->size() / eltsize; assert(dim <= 16 && "Array of non-empty type <= 16 bytes but > 16 elements?"); for (d_uns64 i = 0; i < dim; i++) { - classifyType(accum, ty->next, offset); + classifyType(accum, eltType, offset); offset += eltsize; } }