Index: BasicCompiler64/varlist.cpp
===================================================================
--- BasicCompiler64/varlist.cpp	(revision 73)
+++ BasicCompiler64/varlist.cpp	(revision 75)
@@ -7,7 +7,7 @@
 HWND hVarTree_Global,hVarTree_Local,hVarTree_This;
 
-int VarList_Array(HWND hVarTree,HTREEITEM hParent,LONG_PTR offset,int type,int *SubScripts,LONG_PTR lpIndex);
-void VarList_Member(HWND hVarTree,HTREEITEM hParent,LONG_PTR pTopOffset,CClass *pobj_c,BOOL bPtr);
-void VarList_Insert(HWND hVarTree,TV_INSERTSTRUCT *lptv,char *VarName,int type,LONG_PTR offset,LONG_PTR lpIndex){
+int VarList_Array(HWND hVarTree,HTREEITEM hParent,LONG_PTR offset,const Type &type,const int *SubScripts);
+void VarList_Member(HWND hVarTree,HTREEITEM hParent,LONG_PTR pTopOffset,const CClass &objClass,BOOL bPtr);
+void VarList_Insert(HWND hVarTree,TV_INSERTSTRUCT *lptv,const char *VarName,const Type &type,LONG_PTR offset){
 	extern HANDLE hDebugProcess;
 	int i2;
@@ -22,6 +22,6 @@
 	_int64 i64data;
 
-	if(type==DEF_OBJECT||type==DEF_STRUCT){
-		if( type==DEF_OBJECT ){
+	if( type.IsObject() || type.IsStruct() ){
+		if( type.IsObject() ){
 			// 参照型ということを考慮する
 			ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&stAccBytes);
@@ -34,8 +34,8 @@
 		hParent=TreeView_InsertItem(hVarTree,lptv);
 
-		VarList_Member(hVarTree,hParent,offset,(CClass *)lpIndex,0);
+		VarList_Member(hVarTree,hParent,offset,type.GetClass(),0);
 		return;
 	}
-	if(type==DEF_PTR_OBJECT||type==DEF_PTR_STRUCT){
+	else if( type.IsObjectPtr() || type.IsStructPtr() ){
 		i2=ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&stAccBytes);
 
@@ -45,9 +45,9 @@
 		hParent=TreeView_InsertItem(hVarTree,lptv);
 
-		if(i2) VarList_Member(hVarTree,hParent,pData,(CClass *)lpIndex,1);
+		if(i2) VarList_Member(hVarTree,hParent,pData,type.GetClass(),1);
 		return;
 	}
 	else{
-		if(type==MAKE_PTR_TYPE(DEF_SBYTE,1)||type==MAKE_PTR_TYPE(DEF_BYTE,1)){
+		if(type.GetBasicType()==MAKE_PTR_TYPE(DEF_SBYTE,1)||type.GetBasicType()==MAKE_PTR_TYPE(DEF_BYTE,1)){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&stAccBytes)){
 				for(i2=0;;i2++){
@@ -67,5 +67,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_DOUBLE){
+		else if(type.IsDouble()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&dbl,sizeof(double),&stAccBytes)){
 				sprintf(lptv->item.pszText,"%s %.15g",VarName,dbl);
@@ -73,5 +73,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_SINGLE){
+		else if(type.IsSingle()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&flt,sizeof(float),&stAccBytes)){
 				sprintf(lptv->item.pszText,"%s %.6g",VarName,flt);
@@ -79,5 +79,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_INT64){
+		else if(type.IsInt64()){
 			_int64 i64data;
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&i64data,sizeof(_int64),&stAccBytes)){
@@ -89,5 +89,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_QWORD||IsPtrType(type)){
+		else if(type.IsQWord()||type.IsPointer()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&i64data,sizeof(_int64),&stAccBytes)){
 				_ui64toa(i64data,temporary,10);
@@ -98,5 +98,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_LONG){
+		else if(type.IsLong()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&i64data,sizeof(_int64),&stAccBytes)){
 				sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,i64data,i64data);
@@ -104,5 +104,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_DWORD){
+		else if(type.IsDWord()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&i64data,sizeof(_int64),&stAccBytes)){
 				sprintf(lptv->item.pszText,"%s %u(&H%X)",VarName,i64data,i64data);
@@ -110,5 +110,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){
+		else if(type.IsInteger()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&wData,sizeof(WORD),&stAccBytes)){
 				sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,(short)wData,(short)wData);
@@ -116,5 +116,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_WORD){
+		else if(type.IsWord()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&wData,sizeof(WORD),&stAccBytes)){
 				sprintf(lptv->item.pszText,"%s %u(&H%X)",VarName,wData,wData);
@@ -122,5 +122,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		else if(type.IsSByte()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&byteData,sizeof(BYTE),&stAccBytes)){
 				temporary[0]=byteData;
@@ -130,5 +130,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_BYTE){
+		else if(type.IsByte()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&byteData,sizeof(BYTE),&stAccBytes)){
 				temporary[0]=byteData;
@@ -138,5 +138,5 @@
 			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
 		}
-		else if(type==DEF_BOOLEAN){
+		else if(type.IsBoolean()){
 			if(ReadProcessMemory(hDebugProcess,(void *)offset,&byteData,sizeof(BYTE),&stAccBytes)){
 				if( byteData ) lstrcpy( temporary, "True" );
@@ -152,5 +152,5 @@
 	TreeView_InsertItem(hVarTree,lptv);
 }
-void VarList_Member(HWND hVarTree,HTREEITEM hParent,LONG_PTR pTopOffset,CClass *pobj_c,BOOL bPtr){
+void VarList_Member(HWND hVarTree,HTREEITEM hParent,LONG_PTR pTopOffset,const CClass &objClass,BOOL bPtr){
 	int i,i2;
 	char VarData[VN_SIZE],VarName[VN_SIZE];
@@ -163,18 +163,18 @@
 	tv.item.pszText=VarData;
 
-	for(i=0;i<pobj_c->iMemberNum;i++){
+	for(i=0;i<objClass.iMemberNum;i++){
 		if(bPtr){
 			lstrcpy(VarName,"->");
-			lstrcat(VarName,pobj_c->ppobj_Member[i]->name);
+			lstrcat(VarName,objClass.ppobj_Member[i]->name);
 		}
 		else{
 			lstrcpy(VarName,".");
-			lstrcat(VarName,pobj_c->ppobj_Member[i]->name);
+			lstrcat(VarName,objClass.ppobj_Member[i]->name);
 		}
 
 		LONG_PTR offset;
-		offset=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i]->name, &i2 );
-
-		if(pobj_c->ppobj_Member[i]->SubScripts[0]!=-1){
+		offset=objClass.GetMemberOffset( objClass.ppobj_Member[i]->name, &i2 );
+
+		if(objClass.ppobj_Member[i]->SubScripts[0]!=-1){
 			//構造体内の配列
 			sprintf(VarData,"%s %s(&H%X)",VarName,STRING_ARRAY,pTopOffset+offset);
@@ -185,7 +185,6 @@
 			i2=VarList_Array(hVarTree,hParent,
 				pTopOffset+offset,
-				pobj_c->ppobj_Member[i]->TypeInfo.type,
-				pobj_c->ppobj_Member[i]->SubScripts,
-				pobj_c->ppobj_Member[i]->TypeInfo.u.lpIndex);
+				*objClass.ppobj_Member[i],
+				objClass.ppobj_Member[i]->SubScripts);
 		}
 		else{
@@ -194,12 +193,11 @@
 				&tv,
 				VarName,
-				pobj_c->ppobj_Member[i]->TypeInfo.type,
-				pTopOffset+offset,
-				pobj_c->ppobj_Member[i]->TypeInfo.u.lpIndex);
-		}
-	}
-}
-int VarList_Array(HWND hVarTree,HTREEITEM hParent,LONG_PTR offset,int type,int *SubScripts,LONG_PTR lpIndex){
-	int i,i2,i3,ElementNum,MemCounter,UseCount[255],TypeSize;
+				*objClass.ppobj_Member[i],
+				pTopOffset+offset);
+		}
+	}
+}
+int VarList_Array(HWND hVarTree,HTREEITEM hParent,LONG_PTR offset,const Type &type,const int *SubScripts ){
+	int i,i2,i3,ElementNum,MemCounter,UseCount[255];
 	char temporary[VN_SIZE],temp2[DIGIT_SIZE];
 
@@ -210,6 +208,4 @@
 	tv.hParent=hParent;
 	tv.item.pszText=temporary;
-
-	TypeSize=GetTypeSize(type,lpIndex);
 
 	for(i=0;i<255;i++){
@@ -240,6 +236,5 @@
 
 			VarList_Insert(hVarTree,&tv,temporary,type,
-				offset+MemCounter*TypeSize,
-				lpIndex);
+				offset+MemCounter*type.GetSize());
 		}
 
@@ -254,5 +249,4 @@
 void RefreshGlobalVar(void){
 	extern DWORD ImageBase;
-	int i;
 	char temporary[VN_SIZE];
 	TV_INSERTSTRUCT tv;
@@ -269,9 +263,6 @@
 	extern HANDLE hDebugProcess;
 	extern int MemPos_RWSection;
-	extern int MaxGlobalVarNum;
-	extern VARIABLE *GlobalVar;
-
-	for(i=0;i<MaxGlobalVarNum;i++){
-		VARIABLE *pVar=&GlobalVar[i];
+
+	foreach( Variable *pVar, globalVars ){
 
 		//スコープ外の場合は無視
@@ -289,23 +280,23 @@
 
 		if(!pobj_nv->bShow_DefaultSystem_Var){
-			if(memcmp(pVar->name,"_System_",8)==0||
-				memcmp(pVar->name,"_DebugSys_",10)==0||
-				memcmp(pVar->name,"_PromptSys_",11)==0) continue;
+			if(memcmp(pVar->GetName().c_str(),"_System_",8)==0||
+				memcmp(pVar->GetName().c_str(),"_DebugSys_",10)==0||
+				memcmp(pVar->GetName().c_str(),"_PromptSys_",11)==0) continue;
 		}
 		if(!pobj_nv->bShow_Rad_Var){
-			if(memcmp(pVar->name,"_RadSys_",8)==0) continue;
+			if(memcmp(pVar->GetName().c_str(),"_RadSys_",8)==0) continue;
 		}
 		if(!pobj_nv->bShow_GUID_Var){
-			if(memcmp(pVar->name,"GUID_",5)==0||
-				memcmp(pVar->name,"IID_",4)==0||
-				memcmp(pVar->name,"CLSID_",6)==0) continue;
+			if(memcmp(pVar->GetName().c_str(),"GUID_",5)==0||
+				memcmp(pVar->GetName().c_str(),"IID_",4)==0||
+				memcmp(pVar->GetName().c_str(),"CLSID_",6)==0) continue;
 		}
 
 		//静的メンバ
-		if(strstr(pVar->name,".")) continue;
-
-		if(pVar->bArray){
+		if(strstr(pVar->GetName().c_str(),".")) continue;
+
+		if(pVar->IsArray()){
 			sprintf(temporary,"%s %s(&H%X)",
-				pVar->name,
+				pVar->GetName().c_str(),
 				STRING_ARRAY,
 				ImageBase+MemPos_RWSection+pVar->offset);
@@ -316,15 +307,13 @@
 			VarList_Array(hVarTree_Global,hParent,
 				(LONG_PTR)(ImageBase+MemPos_RWSection+pVar->offset),
-				pVar->type,
-				pVar->SubScripts,
-				pVar->u.index);
+				*pVar,
+				pVar->GetSubScriptsPtr());
 		}
 		else{
 			VarList_Insert(hVarTree_Global,
 				&tv,
-				pVar->name,
-				pVar->type,
-				(LONG_PTR)(ImageBase+MemPos_RWSection+pVar->offset),
-				pVar->u.index);
+				pVar->GetName().c_str(),
+				*pVar,
+				(LONG_PTR)(ImageBase+MemPos_RWSection+pVar->offset));
 		}
 	}
@@ -354,23 +343,22 @@
 	if(pobj_dti->lplpSpBase[i2]==0) return;
 
-	extern SubInfo **ppSubHash;
-	SubInfo *psi;
+	extern UserProc **ppSubHash;
+	UserProc *pUserProc;
 	for(i3=0,sw=0;i3<MAX_HASH;i3++){
-		psi=ppSubHash[i3];
-		while(psi){
-			if(rva_to_real(psi->CompileAddress) <= pobj_dti->lplpObp[i2]  &&
-				pobj_dti->lplpObp[i2] < rva_to_real(psi->EndOpAddr)){
+		pUserProc=ppSubHash[i3];
+		while(pUserProc){
+			if(rva_to_real(pUserProc->beginOpAddress) <= pobj_dti->lplpObp[i2]  &&
+				pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->endOpAddress)){
 				sw=1;
 				break;
 			}
 
-			psi=psi->pNextData;
+			pUserProc=pUserProc->pNextData;
 		}
 		if(sw) break;
 	}
-	if(!psi) return;
-
-	for(i=0;i<psi->VarNum;i++){
-		VARIABLE *pVar=&psi->pVar[i];
+	if(!pUserProc) return;
+
+	foreach( Variable *pVar, UserProc::CompilingUserProc().localVars ){
 
 		//スコープ外の場合は無視
@@ -386,7 +374,7 @@
 		}
 
-		if(pVar->bArray){
+		if(pVar->IsArray()){
 			sprintf(temporary,"%s %s(&H%X)",
-				pVar->name,
+				pVar->GetName().c_str(),
 				STRING_ARRAY,
 				pobj_dti->lplpSpBase[i2]+pVar->offset);
@@ -397,19 +385,17 @@
 			VarList_Array(hVarTree_Local,hParent,
 				pobj_dti->lplpSpBase[i2]+pVar->offset,
-				pVar->type,
-				pVar->SubScripts,
-				pVar->u.index);
+				*pVar,
+				pVar->GetSubScriptsPtr());
 		}
 		else{
 			offset=pobj_dti->lplpSpBase[i2]+pVar->offset;
-			if(pVar->fRef){
+			if(pVar->IsRef()){
 				ReadProcessMemory(hDebugProcess,(void *)offset,&lpData,sizeof(LONG_PTR),&stAccBytes);
 				offset=lpData;
 			}
 			VarList_Insert(hVarTree_Local,&tv,
-				pVar->name,
-				pVar->type,
-				offset,
-				pVar->u.index);
+				pVar->GetName().c_str(),
+				*pVar,
+				offset);
 		}
 	}
@@ -422,22 +408,22 @@
 
 	TreeView_DeleteAllItems(hVarTree_This);
-	if(!psi->pobj_ParentClass) return;
+	if(!pUserProc->GetParentClassPtr()) return;
 
 	//Thisポインタを取得
 	LONG_PTR pThis;
-	for(i=0;i<psi->VarNum;i++){
-		if(lstrcmp(psi->pVar[i].name,"_System_LocalThis")==0) break;
-	}
-	if(i==psi->VarNum) return;
-	lpData=pobj_dti->lplpSpBase[i2]+psi->pVar[i].offset;
+	const Variable *pVar = UserProc::CompilingUserProc().localVars.Find( "_System_LocalThis" );
+	if( !pVar ){
+		return;
+	}
+	lpData=pobj_dti->lplpSpBase[i2]+pVar->offset;
 	ReadProcessMemory(hDebugProcess,(void *)lpData,&pThis,sizeof(LONG_PTR),&stAccBytes);
 
-	for(i=0;i<psi->pobj_ParentClass->iMemberNum;i++){
-		offset=psi->pobj_ParentClass->GetMemberOffset( psi->pobj_ParentClass->ppobj_Member[i]->name,&i2);
-
-		if(psi->pobj_ParentClass->ppobj_Member[i]->SubScripts[0]!=-1){
+	for(i=0;i<pUserProc->GetParentClassPtr()->iMemberNum;i++){
+		offset=pUserProc->GetParentClassPtr()->GetMemberOffset( pUserProc->GetParentClassPtr()->ppobj_Member[i]->name,&i2);
+
+		if(pUserProc->GetParentClassPtr()->ppobj_Member[i]->SubScripts[0]!=-1){
 			//配列
 			sprintf(temporary,"%s %s(&H%X)",
-				psi->pobj_ParentClass->ppobj_Member[i]->name,
+				pUserProc->GetParentClassPtr()->ppobj_Member[i]->name,
 				STRING_ARRAY,
 				(DWORD64)offset);
@@ -448,14 +434,12 @@
 			VarList_Array(hVarTree_This,hParent,
 				pThis+offset,
-				psi->pobj_ParentClass->ppobj_Member[i]->TypeInfo.type,
-				psi->pobj_ParentClass->ppobj_Member[i]->SubScripts,
-				psi->pobj_ParentClass->ppobj_Member[i]->TypeInfo.u.lpIndex);
+				*pUserProc->GetParentClassPtr()->ppobj_Member[i],
+				pUserProc->GetParentClassPtr()->ppobj_Member[i]->SubScripts);
 		}
 		else{
 			VarList_Insert(hVarTree_This,&tv,
-				psi->pobj_ParentClass->ppobj_Member[i]->name,
-				psi->pobj_ParentClass->ppobj_Member[i]->TypeInfo.type,
-				pThis+offset,
-				psi->pobj_ParentClass->ppobj_Member[i]->TypeInfo.u.lpIndex);
+				pUserProc->GetParentClassPtr()->ppobj_Member[i]->name,
+				*pUserProc->GetParentClassPtr()->ppobj_Member[i],
+				pThis+offset);
 		}
 	}
@@ -489,5 +473,4 @@
 
 void SetCalcToWatchList(HWND hListView,int iItem,char *buffer){
-	int i;
 	char temporary[255],temp2[255];
 
@@ -498,6 +481,5 @@
 
 	//カッコを相互チェック
-	if(!CheckParenthesis2(buffer)){
-		ListView_SetItemText(hListView,iItem,1,"式の解析に失敗");
+	if(!CheckParenthesis2(buffer)){ListView_SetItemText(hListView,iItem,1,"式の解析に失敗");
 		return;
 	}
@@ -505,19 +487,18 @@
 	double dbl;
 	_int64 i64data;
-	i=StaticCalculation(true, buffer,0,&i64data,0,1);
-	if(IsRealNumberType(i)){
-		memcpy(&dbl,&i64data,sizeof(double));
-	}
-
-	if(i==0){
+	Type resultType;
+	bool isMemoryAccessError;
+	if( !StaticCalculation(true, buffer,0,&i64data,resultType,1,&isMemoryAccessError) ){
 		ListView_SetItemText(hListView,iItem,1,"式の解析に失敗");
 	}
-	else if(i==-1){
+	else if(isMemoryAccessError){
 		ListView_SetItemText(hListView,iItem,1,"アクセスできません");
 	}
 	else{
-		if(IsRealNumberType(i))
+		if(resultType.IsReal()){
+			memcpy(&dbl,&i64data,sizeof(double));
 			sprintf(temporary,"%.15g (&H%08X)",dbl,(int)dbl);
-		else if(Is64Type(i)){
+		}
+		else if(resultType.Is64()){
 			_i64toa(i64data,temporary,10);
 			_i64toa(i64data,temp2,16);
@@ -586,23 +567,23 @@
 
 	//プロシージャ コンボボックス
-	extern SubInfo **ppSubHash;
-	SubInfo *psi;
+	extern UserProc **ppSubHash;
+	UserProc *pUserProc;
 	int sw;
 	SendMessage(hProcCombo,CB_RESETCONTENT,0,0);
 	for(i2=pobj_dti->iProcLevel;i2>=0;i2--){
 		for(i3=0,sw=0;i3<MAX_HASH;i3++){
-			psi=ppSubHash[i3];
-			while(psi){
-				if(rva_to_real(psi->CompileAddress) <= pobj_dti->lplpObp[i2]  &&
-					pobj_dti->lplpObp[i2] < rva_to_real(psi->EndOpAddr)){
-					lstrcpy(temporary,psi->name);
-					sw=1;
-					break;
+			pUserProc=ppSubHash[i3];
+			while(pUserProc){
+				if(rva_to_real(pUserProc->beginOpAddress) <= pobj_dti->lplpObp[i2]  &&
+					pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->endOpAddress)){
+						lstrcpy(temporary,pUserProc->GetName().c_str());
+						sw=1;
+						break;
 				}
-				psi=psi->pNextData;
+				pUserProc=pUserProc->pNextData;
 			}
 			if(sw) break;
 		}
-		if(!psi){
+		if(!pUserProc){
 			if(i2==0){
 				lstrcpy(temporary,"Global");
@@ -699,9 +680,5 @@
 	///////////////////////////////////////////////
 
-	extern VARIABLE *LocalVar;
-	extern int MaxLocalVarNum;
 	int sw;
-
-	MaxLocalVarNum=0;
 
 	i2=(int)SendDlgItemMessage(hDebugWnd,IDC_PROCCOMBO,CB_GETCURSEL,0,0);
@@ -709,16 +686,16 @@
 
 	if(pobj_dti->lplpSpBase[i2]){
-		extern SubInfo **ppSubHash;
-		SubInfo *psi;
+		extern UserProc **ppSubHash;
+		UserProc *pUserProc;
 		for(i3=0,sw=0;i3<MAX_HASH;i3++){
-			psi=ppSubHash[i3];
-			while(psi){
-				if(rva_to_real(psi->CompileAddress) <= pobj_dti->lplpObp[i2]  &&
-					pobj_dti->lplpObp[i2] < rva_to_real(psi->EndOpAddr)){
+			pUserProc=ppSubHash[i3];
+			while(pUserProc){
+				if(rva_to_real(pUserProc->beginOpAddress) <= pobj_dti->lplpObp[i2]  &&
+					pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->endOpAddress)){
 					sw=1;
 					break;
 				}
 
-				psi=psi->pNextData;
+				pUserProc=pUserProc->pNextData;
 			}
 			if(sw) break;
@@ -726,9 +703,7 @@
 
 
-		if(psi){
-			LocalVar=psi->pVar;
-			MaxLocalVarNum=psi->VarNum;
-
-			pobj_CompilingClass=psi->pobj_ParentClass;
+		if(pUserProc){
+			pobj_CompilingClass=pUserProc->GetParentClassPtr();
+			UserProc::CompileStartForUserProc( pUserProc );
 		}
 	}
