src/SemanticAnalysis.cpp
changeset 153 fc91c4a3dfe2
parent 150 457110815c87
child 154 a85a0303bcb8
     1.1 --- a/src/SemanticAnalysis.cpp	Sat Aug 04 23:26:49 2012 -0700
     1.2 +++ b/src/SemanticAnalysis.cpp	Sat Aug 04 23:58:23 2012 -0700
     1.3 @@ -1267,6 +1267,7 @@
     1.4      if (!desctable)
     1.5          return;
     1.6  
     1.7 +    Vector<unsigned> composedList;
     1.8      StructureBufferBuilder builder;
     1.9  
    1.10      Local<Type> type(zone_);
    1.11 @@ -1289,9 +1290,24 @@
    1.12              return;
    1.13  
    1.14          desctable->set(zone_, i, desc);
    1.15 +
    1.16 +        if (type->isStruct() || type->isArray()) {
    1.17 +            if (!composedList.append(i))
    1.18 +                return;
    1.19 +        }
    1.20      }
    1.21  
    1.22 -    Local<StructMap> map(zone_, StructMap::New(zone_, builder));
    1.23 +    Local<FixedArray> composed(zone_);
    1.24 +    if (composedList.length()) {
    1.25 +        composed = FixedArray::New(zone_, composedList.length(), Heap::Tenure_Old);
    1.26 +        if (!composed)
    1.27 +            return;
    1.28 +
    1.29 +        for (unsigned i = 0; i < composedList.length(); i++)
    1.30 +            composed->set(zone_, i, desctable->at(i));
    1.31 +    }
    1.32 +
    1.33 +    Local<StructMap> map(zone_, StructMap::New(zone_, builder, composed));
    1.34      if (!map)
    1.35          return;
    1.36