Index: BasicCompiler32/Compile_ProcOp.cpp
===================================================================
--- BasicCompiler32/Compile_ProcOp.cpp	(revision 50)
+++ BasicCompiler32/Compile_ProcOp.cpp	(revision 51)
@@ -219,5 +219,5 @@
 	extern SUBINFO **ppSubHash;
 	extern BOOL bDebugCompile;
-	int i3,i4,i5,VarSize,LocalVarSchedule,EspOffsetSchedule,BufferSize,BaseOffset;
+	int i3,i4,VarSize,LocalVarSchedule,EspOffsetSchedule,BufferSize,BaseOffset;
 	char temporary[VN_SIZE];
 
@@ -379,5 +379,5 @@
 		if(psi->ReturnType==DEF_OBJECT && psi->isReturnRef == false){
 			//戻り値用オブジェクトのコンストラクタを呼び出す
-			if(psi->u.Return_pobj_c->ConstructorMemberSubIndex!=-1){
+			if( psi->u.Return_pobj_c->GetConstructorMethod() ){
 				sprintf(temporary,"%s.%s()",temp,psi->u.Return_pobj_c->name);
 				OpcodeOthers(temporary);
@@ -462,5 +462,5 @@
 			BOOL bThisIsSuperClass;
 			if(pobj_CompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1;
-			else if(pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex==-1){
+			else if( pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){
 				//インターフェイスを継承したときはコンストラクタを持たない
 				bThisIsSuperClass=1;
@@ -497,7 +497,6 @@
 					RemoveStringPare(temporary);
 
-					i3=pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex;
 					Opcode_CallProc(temporary,
-						pobj_CompilingClass->ppobj_Method[i3]->psi,
+						pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->psi,
 						0,
 						"",
@@ -506,7 +505,6 @@
 				else{
 					//基底クラスのコンストラクタを暗黙的に呼び出す
-					i3=pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex;
 					Opcode_CallProc("",
-						pobj_CompilingClass->ppobj_Method[i3]->psi,
+						pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->psi,
 						0,
 						"",
@@ -524,19 +522,17 @@
 			for(i3=0;i3<pobj_CompilingClass->iMemberNum;i3++){
 				CMember *pMember = pobj_CompilingClass->ppobj_Member[i3];
+				MemberTypeSize=
+					GetTypeSize(pMember->TypeInfo.type,
+						pMember->TypeInfo.u.lpIndex);
+
+				MemberObjectNum=
+					JumpSubScripts(pMember->SubScripts);
 
 				offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL);
 
-				if(pMember->TypeInfo.type==DEF_OBJECT){
-					if(pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex!=-1){
-						i5=pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex;
-						if(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi->RealParmNum==1){	//Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる
-
-							MemberTypeSize=
-								GetTypeSize(pMember->TypeInfo.type,
-									pMember->TypeInfo.u.lpIndex);
-
-							MemberObjectNum=
-								JumpSubScripts(pMember->SubScripts);
-
+				if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){
+					CMethod *method = pMember->TypeInfo.u.pobj_Class->GetConstructorMethod();
+					if( method ){
+						if( method->psi->RealParmNum == 1 ){	//Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる
 							for(i4=0;i4<MemberObjectNum;i4++){
 								//Thisポインタをecxにコピー
@@ -553,5 +549,5 @@
 
 								//call constructor
-								op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);
+								op_call( method->psi );
 							}
 						}
@@ -618,8 +614,8 @@
 					基底クラスのデストラクタを呼び出す */
 
-				i3=pobj_CompilingClass->pobj_InheritsClass->DestructorMemberSubIndex;
-				if(i3!=-1){
+				CMethod *method = pobj_CompilingClass->pobj_InheritsClass->GetDestructorMethod();
+				if( method ){
 					Opcode_CallProc("",
-						pobj_CompilingClass->ppobj_Method[i3]->psi,
+						method->psi,
 						0,
 						"",
@@ -647,5 +643,6 @@
 
 				if(pMember->TypeInfo.type==DEF_OBJECT){
-					if(pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex!=-1){
+					CMethod *method = pMember->TypeInfo.u.pobj_Class->GetDestructorMethod();
+					if( method ){
 						for(i4=MemberObjectNum-1;i4>=0;i4--){
 							//Thisポインタをecxにコピー
@@ -662,6 +659,5 @@
 
 							//call destructor
-							i5=pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex;
-							op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);
+							op_call( method->psi );
 						}
 					}
