Changeset 18 in dev for BasicCompiler32/Compile_CallProc.cpp
- Timestamp:
- Dec 24, 2006, 4:46:12 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_CallProc.cpp
r11 r18 222 222 223 223 BOOL bStatic=0; 224 CClass *pobj_c; 224 CClass *pobj_c = NULL; 225 CMethod *pMethod = NULL; 225 226 if(psi->pobj_ParentClass){ 226 227 //クラスのメンバ関数を呼び出す場合はアクセスチェックを行う … … 254 255 255 256 256 DWORD dwAccess; 257 for(i=0;i<pobj_c->iMethodNum;i++){ 258 if(psi==pobj_c->ppobj_Method[i]->psi) break; 259 } 260 if(i==pobj_c->iMethodNum){ 261 for(i=0;i<pobj_c->iStaticMethodNum;i++){ 262 if(psi==pobj_c->ppobj_StaticMethod[i]->psi) break; 263 } 264 dwAccess=pobj_c->ppobj_StaticMethod[i]->dwAccess; 265 266 bStatic=1; 267 } 268 else dwAccess=pobj_c->ppobj_Method[i]->dwAccess; 257 ///////////////////////////////// 258 // メソッド情報を取得 259 ///////////////////////////////// 260 pMethod = pobj_c->GetMethodInfo( psi ); 261 if( !pMethod ){ 262 //動的メソッドが取得できなかったときは静的メソッドを当たる 263 pMethod = pobj_c->GetStaticMethodInfo( psi ); 264 if( !pMethod ){ 265 SetError(300,NULL,cp); 266 return -1; 267 } 268 } 269 269 270 270 … … 272 272 // アクセスエラーチェック 273 273 ////////////////////////////// 274 DWORD dwAccess = pMethod->dwAccess; 274 275 275 276 if(ObjectName[0]){ … … 380 381 if(ObjectName[0]){ 381 382 if(lstrcmpi(ObjectName,"Super")==0) goto InClassMember; 382 383 RELATIVE_VAR RelativeVar; 384 if(!GetVarOffsetReadOnly(ObjectName,&i2,&RelativeVar,0)) return -1; 385 SetVarPtrToEax(&RelativeVar); 386 387 //参照タイプが整合しているかをチェック 388 if(i2!=RefType) SetError(104,ObjectName,cp); 389 390 if(i2==DEF_PTR_OBJECT){ 391 //mov eax,dword ptr[eax] 383 else{ 384 RELATIVE_VAR RelativeVar; 385 if( pMethod->isConst ){ 386 //Constアクセスが可能なメソッドの場合 387 if( !GetVarOffsetReadOnly( ObjectName, &i2, &RelativeVar, 0 ) ) return -1; 388 } 389 else{ 390 //Constアクセスが不可能なメソッドの場合 391 if( !GetVarOffsetReadWrite( ObjectName, &i2, &RelativeVar, 0 ) ) return -1; 392 } 393 394 SetVarPtrToEax(&RelativeVar); 395 396 //参照タイプが整合しているかをチェック 397 if(i2!=RefType) SetError(104,ObjectName,cp); 398 399 if(i2==DEF_PTR_OBJECT){ 400 //mov eax,dword ptr[eax] 401 OpBuffer[obp++]=(char)0x8B; 402 OpBuffer[obp++]=(char)0x00; 403 } 404 405 //mov ecx,eax 392 406 OpBuffer[obp++]=(char)0x8B; 393 OpBuffer[obp++]=(char)0x00; 394 } 395 396 //mov ecx,eax 397 OpBuffer[obp++]=(char)0x8B; 398 OpBuffer[obp++]=(char)0xC8; 407 OpBuffer[obp++]=(char)0xC8; 408 } 399 409 } 400 410 else{
Note:
See TracChangeset
for help on using the changeset viewer.