Index: trunk/abdev/BasicCompiler32/BasicCompiler.vcproj
===================================================================
--- trunk/abdev/BasicCompiler32/BasicCompiler.vcproj	(revision 259)
+++ trunk/abdev/BasicCompiler32/BasicCompiler.vcproj	(revision 260)
@@ -1253,12 +1253,4 @@
 					>
 				</File>
-				<Filter
-					Name="CoreClasses"
-					>
-					<File
-						RelativePath="..\BasicCompiler_Common\src\CommonCodeGenerator.cpp"
-						>
-					</File>
-				</Filter>
 			</Filter>
 			<Filter
@@ -1267,4 +1259,8 @@
 				<File
 					RelativePath="..\BasicCompiler_Common\src\CodeGenerator.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\CommonCodeGenerator.cpp"
 					>
 				</File>
Index: trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp	(revision 259)
+++ trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp	(revision 260)
@@ -402,9 +402,7 @@
 	compiler.codeGenerator._exitSubCodePositions_ObpOld.clear();
 
-	//ラベル用のメモリを確保
-	extern LABEL *pLabelNames;
-	extern int MaxLabelNum;
-	pLabelNames=(LABEL *)HeapAlloc(hHeap,0,1);
-	MaxLabelNum=0;
+	//ラベル管理オブジェクトを初期化
+	extern Labels labels;
+	labels.clear();
 
 	//Gotoラベルスケジュール
@@ -581,10 +579,4 @@
 	}
 
-	//ラベル用のメモリを解放
-	for(i3=0;i3<MaxLabelNum;i3++){
-		if(pLabelNames[i3].pName) HeapDefaultFree(pLabelNames[i3].pName);
-	}
-	HeapDefaultFree(pLabelNames);
-
 	//With情報のメモリを解放
 	for(i3=0;i3<WithInfo.num;i3++){
Index: trunk/abdev/BasicCompiler32/Compile_Statement.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 259)
+++ trunk/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 260)
@@ -279,19 +279,27 @@
 
 int GetLabelAddress(char *LabelName,int LineNum){
-	extern int MaxLabelNum;
-	extern LABEL *pLabelNames;
-	int i;
+	extern Labels labels;
 
 	if(LabelName){
-		for(i=0;i<MaxLabelNum;i++){
-			if(pLabelNames[i].pName){
-				if(lstrcmp(LabelName,pLabelNames[i].pName)==0) return pLabelNames[i].address;
+		BOOST_FOREACH( const Label &label, labels )
+		{
+			if( label.name.size() > 0 )
+			{
+				if( label.name == LabelName )
+				{
+					return label.address;
+				}
 			}
 		}
 	}
 	else{
-		for(i=0;i<MaxLabelNum;i++){
-			if(pLabelNames[i].pName==0){
-				if(LineNum==pLabelNames[i].line) return pLabelNames[i].address;
+		BOOST_FOREACH( const Label &label, labels )
+		{
+			if( label.name.size() == 0 )
+			{
+				if( label.line == LineNum )
+				{
+					return label.address;
+				}
 			}
 		}
@@ -309,5 +317,4 @@
 		{
 			//jmp ...(schedule)
-			extern int obp;
 			compiler.codeGenerator.op_jmp_goto_schedule( (const std::string)(Parameter + 1), 0, cp );
 		}
@@ -326,5 +333,4 @@
 		{
 			//jmp ...(schedule)
-			extern int obp;
 			compiler.codeGenerator.op_jmp_goto_schedule( "", LineNum, cp );
 		}
Index: trunk/abdev/BasicCompiler32/MakePeHdr.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 259)
+++ trunk/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 260)
@@ -417,9 +417,7 @@
 		}
 
-		//ラベル用のメモリを確保
-		extern LABEL *pLabelNames;
-		extern int MaxLabelNum;
-		pLabelNames=(LABEL *)HeapAlloc(hHeap,0,1);
-		MaxLabelNum=0;
+		//ラベル管理オブジェクトを初期化
+		extern Labels labels;
+		labels.clear();
 
 		//Gotoラベルスケジュール
@@ -465,10 +463,4 @@
 		//グローバル実行領域をコンパイル開始
 		CompileBuffer(0,0);
-
-		//ラベル用のメモリを解放
-		for(i=0;i<MaxLabelNum;i++){
-			if(pLabelNames[i].pName) HeapDefaultFree(pLabelNames[i].pName);
-		}
-		HeapDefaultFree(pLabelNames);
 
 		//Goto未知ラベルスケジュールが存在したらエラーにする
Index: trunk/abdev/BasicCompiler32/Opcode.h
===================================================================
--- trunk/abdev/BasicCompiler32/Opcode.h	(revision 259)
+++ trunk/abdev/BasicCompiler32/Opcode.h	(revision 260)
@@ -21,9 +21,25 @@
 
 //ラベルアドレス
-struct LABEL{
-	char *pName;
+class Label
+{
+public:
+	std::string name;
 	int line;
 	DWORD address;
-};
+
+	Label( const std::string &name, long nativeCodePos )
+		: name( name )
+		, line( -1 )
+		, address( nativeCodePos )
+	{
+	}
+	Label( int line, long nativeCodePos )
+		: name( "" )
+		, line( line )
+		, address( nativeCodePos )
+	{
+	}
+};
+typedef std::vector<Label> Labels;
 
 //プロシージャの種類
Index: trunk/abdev/BasicCompiler_Common/Compile.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Compile.cpp	(revision 259)
+++ trunk/abdev/BasicCompiler_Common/Compile.cpp	(revision 260)
@@ -21,6 +21,5 @@
 
 //ラベルアドレス
-LABEL *pLabelNames;
-int MaxLabelNum;
+Labels labels;
 
 //グローバル変数初期バッファ
@@ -122,10 +121,6 @@
 	if(Command[0]=='*'&&IsVariableTopChar(Command[1])){
 		//Goto先ラベル
-		pLabelNames=(LABEL *)HeapReAlloc(hHeap,0,pLabelNames,(MaxLabelNum+1)*sizeof(LABEL));
-		pLabelNames[MaxLabelNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Command+1)+1);
-		lstrcpy(pLabelNames[MaxLabelNum].pName,Command+1);
 		extern int obp;
-		pLabelNames[MaxLabelNum].address=obp;
-		MaxLabelNum++;
+		labels.push_back( Label( Command + 1, obp ) );
 
 		//書き込みスケジュール
@@ -538,10 +533,6 @@
 
 				//Goto先ラベル
-				pLabelNames=(LABEL *)HeapReAlloc(hHeap,0,pLabelNames,(MaxLabelNum+1)*sizeof(LABEL));
-				pLabelNames[MaxLabelNum].pName=0;
-				pLabelNames[MaxLabelNum].line=i3;
 				extern int obp;
-				pLabelNames[MaxLabelNum].address=obp;
-				MaxLabelNum++;
+				labels.push_back( Label( (long)i3, obp ) );
 
 				//書き込みスケジュール
