Changeset 51 in dev for BasicCompiler64/Compile_ProcOp.cpp
- Timestamp:
- Feb 10, 2007, 8:30:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/Compile_ProcOp.cpp
r50 r51 209 209 extern SUBINFO **ppSubHash; 210 210 extern BOOL bDebugCompile; 211 int i3,i4, i5,VarSize,BufferSize;211 int i3,i4,VarSize,BufferSize; 212 212 char temporary[VN_SIZE]; 213 213 … … 466 466 if(psi->ReturnType==DEF_OBJECT && psi->isReturnRef == false){ 467 467 //戻り値用オブジェクトのコンストラクタを呼び出す 468 if( psi->u.Return_pobj_c->ConstructorMemberSubIndex!=-1){468 if( psi->u.Return_pobj_c->GetConstructorMethod() ){ 469 469 sprintf(temporary,"%s.%s()",temp,psi->u.Return_pobj_c->name); 470 470 OpcodeOthers(temporary); … … 517 517 BOOL bThisIsSuperClass; 518 518 if(pobj_CompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1; 519 else if( pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex==-1){519 else if( pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){ 520 520 //インターフェイスを継承したときはコンストラクタを持たない 521 521 bThisIsSuperClass=1; … … 552 552 RemoveStringPare(temporary); 553 553 554 i3=pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex;555 554 Opcode_CallProc(temporary, 556 pobj_CompilingClass->p pobj_Method[i3]->psi,555 pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->psi, 557 556 0, 558 557 "", … … 561 560 else{ 562 561 //基底クラスのコンストラクタを暗黙的に呼び出す 563 i3=pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex;564 562 Opcode_CallProc("", 565 pobj_CompilingClass->p pobj_Method[i3]->psi,563 pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->psi, 566 564 0, 567 565 "", … … 588 586 589 587 if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){ 590 if(pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex!=-1){591 i5=pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex;592 if( pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi->RealParmNum==1){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる588 CMethod *method = pMember->TypeInfo.u.pobj_Class->GetConstructorMethod(); 589 if( method ){ 590 if( method->psi->RealParmNum == 1 ){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる 593 591 for(i4=0;i4<MemberObjectNum;i4++){ 594 592 //Thisポインタをrcxにコピー … … 599 597 600 598 //call constructor 601 op_call( pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);599 op_call( method->psi ); 602 600 } 603 601 } … … 662 660 基底クラスのデストラクタを呼び出す */ 663 661 664 i3=pobj_CompilingClass->pobj_InheritsClass->DestructorMemberSubIndex;665 if( i3!=-1){662 CMethod *method = pobj_CompilingClass->pobj_InheritsClass->GetDestructorMethod(); 663 if( method ){ 666 664 Opcode_CallProc("", 667 pobj_CompilingClass->ppobj_Method[i3]->psi,665 method->psi, 668 666 0, 669 667 "", … … 689 687 690 688 if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){ 691 if(pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex!=-1){ 689 CMethod *method = pMember->TypeInfo.u.pobj_Class->GetDestructorMethod(); 690 if( method ){ 692 691 for(i4=MemberObjectNum-1;i4>=0;i4--){ 693 692 //Thisポインタをrcxにコピー … … 698 697 699 698 //call destructor 700 i5=pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex; 701 op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi); 699 op_call(method->psi); 702 700 } 703 701 }
Note:
See TracChangeset
for help on using the changeset viewer.