Changeset 40 in dev for BasicCompiler32/Compile_ProcOp.cpp
- Timestamp:
- Jan 28, 2007, 3:48:22 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_ProcOp.cpp
r36 r40 374 374 else temp=psi->name; 375 375 376 if(psi->ReturnType==DEF_OBJECT ){376 if(psi->ReturnType==DEF_OBJECT && psi->isReturnRef == false){ 377 377 //戻り値用オブジェクトのコンストラクタを呼び出す 378 378 if(psi->u.Return_pobj_c->ConstructorMemberSubIndex!=-1){ … … 383 383 else{ 384 384 //戻り値用の変数の定義 385 sprintf(temporary,"%s%c%c",temp,1,ESC_AS); 385 if( psi->isReturnRef ){ 386 sprintf(temporary,"%c%c",1,ESC_BYREF); 387 } 388 else temporary[0]=0; 389 390 sprintf(temporary+lstrlen(temporary),"%s%c%c",temp,1,ESC_AS); 386 391 GetTypeName(psi->ReturnType,psi->u.ReturnIndex,temporary+lstrlen(temporary)); 392 387 393 OpcodeDim(temporary,0); 388 394 } … … 514 520 else offset=0; 515 521 for(i3=0;i3<pobj_CompilingClass->iMemberNum;i3++){ 516 offset=GetSizeOfClassMember(pobj_CompilingClass,pobj_CompilingClass->ppobj_Member[i3]->name,NULL); 517 518 if(pobj_CompilingClass->ppobj_Member[i3]->TypeInfo.type==DEF_OBJECT){ 519 if(pobj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex!=-1){ 520 i5=pobj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex; 521 if(pobj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi->RealParmNum==1){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる 522 CMember *pMember = pobj_CompilingClass->ppobj_Member[i3]; 523 524 offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL); 525 526 if(pMember->TypeInfo.type==DEF_OBJECT){ 527 if(pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex!=-1){ 528 i5=pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex; 529 if(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi->RealParmNum==1){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる 522 530 523 531 MemberTypeSize= 524 GetTypeSize(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.type,525 p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.lpIndex);532 GetTypeSize(pMember->TypeInfo.type, 533 pMember->TypeInfo.u.lpIndex); 526 534 527 535 MemberObjectNum= 528 JumpSubScripts(p obj_CompilingClass->ppobj_Member[i3]->SubScripts);536 JumpSubScripts(pMember->SubScripts); 529 537 530 538 for(i4=0;i4<MemberObjectNum;i4++){ … … 542 550 543 551 //call constructor 544 op_call(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);552 op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi); 545 553 } 546 554 } … … 624 632 offset=GetTypeSize(DEF_OBJECT,(LONG_PTR)pobj_CompilingClass); 625 633 for(i3=pobj_CompilingClass->iMemberNum-1;i3>=0;i3--){ 634 CMember *pMember = pobj_CompilingClass->ppobj_Member[i3]; 635 626 636 MemberTypeSize= 627 GetTypeSize(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.type,628 p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.lpIndex);637 GetTypeSize(pMember->TypeInfo.type, 638 pMember->TypeInfo.u.lpIndex); 629 639 630 640 MemberObjectNum= 631 JumpSubScripts(p obj_CompilingClass->ppobj_Member[i3]->SubScripts);641 JumpSubScripts(pMember->SubScripts); 632 642 633 643 offset-=MemberTypeSize*MemberObjectNum; 634 644 635 if(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.type==DEF_OBJECT){636 if(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->DestructorMemberSubIndex!=-1){645 if(pMember->TypeInfo.type==DEF_OBJECT){ 646 if(pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex!=-1){ 637 647 for(i4=MemberObjectNum-1;i4>=0;i4--){ 638 648 //Thisポインタをecxにコピー … … 649 659 650 660 //call destructor 651 i5=p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->DestructorMemberSubIndex;652 op_call(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);661 i5=pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex; 662 op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi); 653 663 } 654 664 }
Note:
See TracChangeset
for help on using the changeset viewer.