Index: BasicCompiler_Common/hash.cpp
===================================================================
--- BasicCompiler_Common/hash.cpp	(revision 47)
+++ BasicCompiler_Common/hash.cpp	(revision 50)
@@ -53,29 +53,5 @@
 }
 
-SUBINFO **GetOverloadObjectSubHash(char *name,CClass *pobj_c, int *pNum){
-	int i;
-
-
-	//格納のための構造体配列を用意
-	extern HANDLE hHeap;
-	SUBINFO **ppArray_si;
-	int num=0;
-	ppArray_si=(SUBINFO **)HeapAlloc(hHeap,0,sizeof(SUBINFO *)*1024);
-
-
-	//オブジェクトのメンバ関数の場合
-	//※オーバーライドされた関数を先にサーチする必要があるため、バックサーチを行う
-	for(i=pobj_c->iMethodNum-1;i>=0;i--){
-		if(lstrcmp(name,pobj_c->ppobj_Method[i]->psi->name)==0){
-			ppArray_si[num]=pobj_c->ppobj_Method[i]->psi;
-			num++;
-		}
-	}
-
-	*pNum=num;
-	return ppArray_si;
-}
-
-SUBINFO **GetOverloadSubHash( const char *lpszName, int *pNum ){
+void GetOverloadSubHash( const char *lpszName, std::vector<SUBINFO *> &subs ){
 	extern SUBINFO *pSubInfo;
 	extern int SubInfoNum;
@@ -90,11 +66,4 @@
 	}
 	else lstrcpy(name,lpszName);
-
-
-	//格納のための構造体配列を用意
-	extern HANDLE hHeap;
-	SUBINFO **ppArray_si;
-	int num=0;
-	ppArray_si=(SUBINFO **)HeapAlloc(hHeap,0,sizeof(SUBINFO *)*1024);
 
 
@@ -122,5 +91,5 @@
 				}
 				else{
-					goto finish;
+					return;
 				}
 			}
@@ -129,10 +98,5 @@
 		if( isStatic ){
 			// 静的メソッドから取得
-			for(i=0;i<pobj_c->iStaticMethodNum;i++){
-				if(lstrcmp(NestMember,pobj_c->ppobj_StaticMethod[i]->psi->name)==0){
-					ppArray_si[num]=pobj_c->ppobj_StaticMethod[i]->psi;
-					num++;
-				}
-			}
+			pobj_c->EnumStaticMethod( NestMember, subs );
 		}
 		else{
@@ -142,6 +106,5 @@
 			for(i=pobj_c->iMethodNum-1;i>=0;i--){
 				if(lstrcmp(NestMember,pobj_c->ppobj_Method[i]->psi->name)==0){
-					ppArray_si[num]=pobj_c->ppobj_Method[i]->psi;
-					num++;
+					subs.push_back( pobj_c->ppobj_Method[i]->psi );
 				}
 			}
@@ -161,10 +124,5 @@
 			CClass *pobj_c = pobj_CompilingClass;
 
-			for(i=0;i<pobj_c->iStaticMethodNum;i++){
-				if(lstrcmp(name,pobj_c->ppobj_StaticMethod[i]->psi->name)==0){
-					ppArray_si[num]=pobj_c->ppobj_StaticMethod[i]->psi;
-					num++;
-				}
-			}
+			pobj_c->EnumStaticMethod( NestMember, subs );
 
 
@@ -178,6 +136,5 @@
 			for(;i<pobj_CompilingClass->iMethodNum;i++){
 				if(lstrcmp(name,pobj_CompilingClass->ppobj_Method[i]->psi->name)==0){
-					ppArray_si[num]=pobj_CompilingClass->ppobj_Method[i]->psi;
-					num++;
+					subs.push_back( pobj_CompilingClass->ppobj_Method[i]->psi );
 				}
 			}
@@ -188,6 +145,5 @@
 				if(pobj_CompilingClass->ppobj_Method[i]->pobj_InheritsClass){
 					if(lstrcmp(name,pobj_CompilingClass->ppobj_Method[i]->psi->name)==0){
-						ppArray_si[num]=pobj_CompilingClass->ppobj_Method[i]->psi;
-						num++;
+						subs.push_back( pobj_CompilingClass->ppobj_Method[i]->psi );
 					}
 				}
@@ -211,6 +167,5 @@
 			if(!psi->pobj_ParentClass){
 				if(lstrcmp(psi->name,name)==0){
-					ppArray_si[num]=psi;
-					num++;
+					subs.push_back( psi );
 				}
 			}
@@ -220,30 +175,23 @@
 
 	}
-finish:
-
-	*pNum=num;
-	return ppArray_si;
 }
 
 //オーバーロードされていない関数を取得（昔のコンパイラソースコードとの互換性保持）
 SUBINFO *GetSubHash(const char *lpszName,BOOL bError){
-	int num;
-	SUBINFO **ppsi,*psi;
-	ppsi = GetOverloadSubHash(lpszName,&num);
+	std::vector<SUBINFO *> subs;
+	GetOverloadSubHash(lpszName,subs);
 
 	//関数が存在しないとき
-	if(num == 0){
-		HeapDefaultFree(ppsi);
+	if(subs.size() == 0){
 		return 0;
 	}
 
 	//一つ以上の関数が存在するときは内部エラー（デバッグ用）
-	if(num > 1){
+	if(subs.size() > 1){
 		if(bError) SetError(300,NULL,cp);
 	}
 
-	psi = ppsi[0];
-
-	HeapDefaultFree(ppsi);
+	SUBINFO *psi;
+	psi = subs[0];
 
 	return psi;
@@ -253,17 +201,15 @@
 	sprintf(temporary,"%s.%s",ObjectName,MethodName);
 
-	int num;
-	SUBINFO **ppsi,*psi;
-	ppsi = GetOverloadSubHash(temporary,&num);
+	std::vector<SUBINFO *> subs;
+	SUBINFO *psi;
+	GetOverloadSubHash(temporary,subs);
 
 	//関数が存在しないとき
-	if(num == 0){
-		HeapDefaultFree(ppsi);
+	if(subs.size() == 0){
 		return 0;
 	}
 
 	//オーバーロードを解決
-	psi=OverloadSolutionWithStrParam(temporary,ppsi,num,Parameter,ObjectName,NULL);
-	HeapDefaultFree(ppsi);
+	psi=OverloadSolutionWithStrParam(temporary,subs,Parameter,ObjectName,NULL);
 
 	return psi;
