Index: BasicCompiler32/CParameter.cpp
===================================================================
--- BasicCompiler32/CParameter.cpp	(revision 50)
+++ BasicCompiler32/CParameter.cpp	(revision 51)
@@ -109,7 +109,7 @@
 
 			//call destructor
-			int i5 = types[i2].u.pobj_Class->DestructorMemberSubIndex;
-			if( i5 != -1 ){
-				op_call( types[i2].u.pobj_Class->ppobj_Method[i5]->psi );
+			CMethod *method = types[i2].u.pobj_Class->GetDestructorMethod();
+			if( method ){
+				op_call( method->psi );
 			}
 
@@ -148,6 +148,6 @@
 	CalcType.type=NumOpe_GetType(Parameter,&BaseType,&CalcType.u.lpIndex);
 
-	if(pobj_Class->CopyConstructorMemberSubIndex!=-1&&
-		CalcType.type==DEF_OBJECT&&CalcType.u.pobj_Class==pobj_Class){
+	if( pobj_Class->GetCopyConstructorMethod()
+		&& CalcType.type==DEF_OBJECT&&CalcType.u.pobj_Class==pobj_Class){
 		////////////////////////////////////
 		// コピーコンストラクタを呼び出す
@@ -179,5 +179,5 @@
 
 		//call constructor
-		op_call(pobj_Class->ppobj_Method[pobj_Class->CopyConstructorMemberSubIndex]->psi);
+		op_call(pobj_Class->GetCopyConstructorMethod()->psi);
 
 
@@ -191,5 +191,5 @@
 
 
-			if(pobj_Class->ConstructorMemberSubIndex!=-1){
+			if( pobj_Class->GetConstructorMethod() ){
 				////////////////////////////////
 				// コンストラクタを呼び出す
@@ -200,5 +200,5 @@
 
 				//call constructor
-				op_call(pobj_Class->ppobj_Method[pobj_Class->ConstructorMemberSubIndex]->psi);
+				op_call(pobj_Class->GetConstructorMethod()->psi);
 			}
 
Index: BasicCompiler32/Compile_CallProc.cpp
===================================================================
--- BasicCompiler32/Compile_CallProc.cpp	(revision 50)
+++ BasicCompiler32/Compile_CallProc.cpp	(revision 51)
@@ -95,5 +95,5 @@
 
 void Opcode_CallProc(char *Parameter,SUBINFO *psi,DWORD dwFlags,char *ObjectName,int RefType){
-	int i,i2;
+	int i2;
 
 	if(psi->dwType==SUBTYPE_MACRO){
@@ -338,8 +338,5 @@
 		OpBuffer[obp++]=(char)0x11;
 
-		for(i=0,i2=0;i<pobj_c->iMethodNum;i++){
-			if(pobj_c->ppobj_Method[i]->psi==psi) break;
-			if(pobj_c->ppobj_Method[i]->psi->bVirtual) i2++;
-		}
+		i2 = pobj_c->GetFuncNumInVtbl( psi );
 
 		//call dword ptr[edx+func_index]
Index: BasicCompiler32/Compile_Func.cpp
===================================================================
--- BasicCompiler32/Compile_Func.cpp	(revision 50)
+++ BasicCompiler32/Compile_Func.cpp	(revision 51)
@@ -324,9 +324,5 @@
 		OpBuffer[obp++]=(char)0x11;
 
-		int i,i2;
-		for(i=0,i2=0;i<pobj_c->iMethodNum;i++){
-			if(pobj_c->ppobj_Method[i]->psi==psi) break;
-			if(pobj_c->ppobj_Method[i]->psi->bVirtual) i2++;
-		}
+		int i2 = pobj_c->GetFuncNumInVtbl( psi );
 
 		//mov eax,dword ptr[edx+func_index]
Index: BasicCompiler32/Compile_Object.cpp
===================================================================
--- BasicCompiler32/Compile_Object.cpp	(revision 50)
+++ BasicCompiler32/Compile_Object.cpp	(revision 51)
@@ -220,10 +220,11 @@
 
 
+	CMethod *method = pobj_c->GetDestructorMethod();
+	if( method == NULL ) return 0;
+
 	//mov ecx,DestructorProcAddr
-	i2=pobj_c->DestructorMemberSubIndex;
-	if(i2==-1) return -1;
 	OpBuffer[obp++]=(char)0xB9;
-	pobj_SubAddrSchedule->add(pobj_c->ppobj_Method[i2]->psi,0);
-	pobj_c->ppobj_Method[i2]->psi->bUse=1;
+	pobj_SubAddrSchedule->add(method->psi,0);
+	method->psi->bUse=1;
 	obp+=sizeof(long);
 
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 );
 						}
 					}
Index: BasicCompiler32/Compile_Statement.cpp
===================================================================
--- BasicCompiler32/Compile_Statement.cpp	(revision 50)
+++ BasicCompiler32/Compile_Statement.cpp	(revision 51)
@@ -106,28 +106,8 @@
 		}
 		if(i2==DEF_OBJECT){
-			CClass *pobj_Class;
-			pobj_Class=(CClass *)lp;
-			if(pobj_Class->DestructorMemberSubIndex!=-1){
-				//デストラクタの呼び出し
-
-				//push eax
-				op_push(REG_EAX);
-
-				//push eax
-				op_push(REG_EAX);
-
-				//call destructor
-				int i5;
-				i5=pobj_Class->DestructorMemberSubIndex;
-				op_call(pobj_Class->ppobj_Method[i5]->psi);
-			}
-			else{
-				//push eax
-				op_push(REG_EAX);
-			}
-
-			//call free
-			extern SUBINFO *pSub_free;
-			op_call(pSub_free);
+			//mov ebx,eax
+			op_mov_RR(REG_EBX,REG_EAX);
+
+			FreeTempObject(REG_EBX,(CClass *)lp);
 		}
 		return;
Index: BasicCompiler32/MakePeHdr.cpp
===================================================================
--- BasicCompiler32/MakePeHdr.cpp	(revision 50)
+++ BasicCompiler32/MakePeHdr.cpp	(revision 51)
@@ -1049,4 +1049,9 @@
 	// プロシージャポインタスケジュール
 	for(i=0;i<pobj_SubAddrSchedule->num;i++){
+		if(pobj_SubAddrSchedule->ppsi[i]->CompileAddress==0
+			&&pobj_SubAddrSchedule->ppsi[i]->EndOpAddr==0){
+			SetError(300,NULL,-1);
+		}
+
 		if(pobj_SubAddrSchedule->pbCall[i]){
 			*((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))=
Index: BasicCompiler32/NumOpe.cpp
===================================================================
--- BasicCompiler32/NumOpe.cpp	(revision 50)
+++ BasicCompiler32/NumOpe.cpp	(revision 51)
@@ -96,5 +96,5 @@
 
 		//call constructor
-		op_call(pobj_StringClass->ppobj_Method[pobj_StringClass->ConstructorMemberSubIndex]->psi);
+		op_call(pobj_StringClass->GetConstructorMethod()->psi);
 	}
 
Index: BasicCompiler32/OperatorProc.cpp
===================================================================
--- BasicCompiler32/OperatorProc.cpp	(revision 50)
+++ BasicCompiler32/OperatorProc.cpp	(revision 51)
@@ -5,10 +5,11 @@
 	if(!IsSafeReg(reg)) SetError(300,NULL,cp);
 
-	if(pobj_c->DestructorMemberSubIndex!=-1){
+	CMethod *method = pobj_c->GetDestructorMethod();
+	if( method ){
 		//push reg
 		op_push(reg);
 
 		//call DestructorProcAddr
-		op_call(pobj_c->ppobj_Method[pobj_c->DestructorMemberSubIndex]->psi);
+		op_call( method->psi );
 	}
 
