| 2711 | } |
| 2712 | |
| 2713 | void AddDefaultConstructorCall(const char* pos, const char* name) |
| 2714 | { |
| 2715 | TypeInfo *type = CodeInfo::nodeList.back()->typeInfo; |
| 2716 | |
| 2717 | if(const char* tmp = strrchr(name, '.')) |
| 2718 | name = tmp + 1; |
| 2719 | |
| 2720 | assert(type->subType); |
| 2721 | if(!type->subType->arrLevel) |
| 2722 | { |
| 2723 | AddMemberFunctionCall(pos, name, 0); |
| 2724 | AddPopNode(pos); |
| 2725 | return; |
| 2726 | } |
| 2727 | |
| 2728 | IncreaseCycleDepth(); |
| 2729 | BeginBlock(); |
| 2730 | |
| 2731 | assert(type->refLevel && type->subType->arrLevel); |
| 2732 | type = type->subType->subType; |
| 2733 | assert(!type->refLevel && !type->funcType); |
| 2734 | |
| 2735 | char *arrName = AllocateString(16); |
| 2736 | int length = sprintf(arrName, "$temp%d", inplaceVariableNum++); |
| 2737 | InplaceStr vName = InplaceStr(arrName, length); |
| 2738 | |
| 2739 | AddGetVariableNode(pos); |
| 2740 | AddArrayIterator(pos, vName, NULL); |
| 2741 | |
| 2742 | AddGetAddressNode(pos, vName); |
| 2743 | AddDefaultConstructorCall(pos, name); |
| 2744 | |
| 2745 | EndBlock(); |
| 2746 | AddForEachNode(pos); |
| 2747 | |
| 2748 | NodeZeroOP *last = CodeInfo::nodeList.back(); |
| 2749 | CodeInfo::nodeList.pop_back(); |
| 2750 | |
| 2751 | NodeOneOP *wrap = new NodeOneOP(); |
| 2752 | wrap->SetFirstNode(last); |
| 2753 | CodeInfo::nodeList.push_back(wrap); |
| 2754 | } |
| 2755 | |
| 2756 | NodeZeroOP* PrepareConstructorCall(const char* pos) |
| 2757 | { |
no test coverage detected