Index: /trunk/abdev/BasicCompiler_Common/VarList.cpp
===================================================================
--- /trunk/abdev/BasicCompiler_Common/VarList.cpp	(revision 392)
+++ /trunk/abdev/BasicCompiler_Common/VarList.cpp	(revision 393)
@@ -372,7 +372,11 @@
 
 		//スコープ外の場合は無視
-		if(pVar->GetScopeLevel()!=0){
-			if(rva_to_real(pVar->GetScopeStartAddress()) <= pobj_dti->lplpObp[i2]  &&
-				pobj_dti->lplpObp[i2] < rva_to_real(pVar->GetScopeEndAddress())){
+		int scopeBeginAddressRva = pUserProc->GetBeginOpAddress() + pVar->GetScopeStartAddress();
+		int scopeEndAddressRva = pUserProc->GetBeginOpAddress() + pVar->GetScopeEndAddress();
+		if(pVar->GetScopeLevel()!=0)
+		{
+			if( rva_to_real( scopeBeginAddressRva ) <= pobj_dti->lplpObp[i2]
+				&& pobj_dti->lplpObp[i2] < rva_to_real( scopeEndAddressRva ) )
+			{
 				//範囲内
 			}
Index: /trunk/abdev/BasicCompiler_Common/common.h
===================================================================
--- /trunk/abdev/BasicCompiler_Common/common.h	(revision 392)
+++ /trunk/abdev/BasicCompiler_Common/common.h	(revision 393)
@@ -214,5 +214,5 @@
 //BasicCompiler.cpp
 void HeapDefaultFree(LPVOID lpMem);
-void ts(int i);
+void ts(int i = 0);
 void ts(int i,int i2);
 void ts(const char *msg);
Index: /trunk/abdev/BasicCompiler_Common/src/Linker.cpp
===================================================================
--- /trunk/abdev/BasicCompiler_Common/src/Linker.cpp	(revision 392)
+++ /trunk/abdev/BasicCompiler_Common/src/Linker.cpp	(revision 393)
@@ -264,9 +264,16 @@
 		if( pUserProc->GetNativeCode().GetSize() > 0 )
 		{
-			pUserProc->SetBeginOpAddress( nativeCode.GetSize() );
-
+			// 関数の開始位置（コードセクションからのオフセット）
+			int beginCodePos = nativeCode.GetSize();
+
+			// コードセクションに関数のネイティブコードを追加
 			nativeCode.PutEx( pUserProc->GetNativeCode() );
 
-			pUserProc->SetEndOpAddress( nativeCode.GetSize() );
+			// 関数の終了位置（コードセクションからのオフセット）
+			int endCodePos = nativeCode.GetSize();
+
+			// コードセクション内の関数の範囲を設定
+			pUserProc->SetBeginOpAddress( beginCodePos );
+			pUserProc->SetEndOpAddress( endCodePos );
 		}
 	}
