Ignore:
Timestamp:
Dec 24, 2006, 4:46:12 AM (17 years ago)
Author:
dai_9181
Message:

オブジェクト定数に対応。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/Compile_CallProc.cpp

    r11 r18  
    233233
    234234    BOOL bStatic=0;
    235     CClass *pobj_c;
     235    CClass *pobj_c = NULL;
     236    CMethod *pMethod = NULL;
    236237    if(psi->pobj_ParentClass){
    237238        //クラスのメンバ関数を呼び出す場合はアクセスチェックを行う
     
    264265        }
    265266
    266         DWORD dwAccess;
    267         for(i=0;i<pobj_c->iMethodNum;i++){
    268             if(psi==pobj_c->ppobj_Method[i]->psi) break;
    269         }
    270         if(i==pobj_c->iMethodNum){
    271             for(i=0;i<pobj_c->iStaticMethodNum;i++){
    272                 if(psi==pobj_c->ppobj_StaticMethod[i]->psi) break;
    273             }
    274             dwAccess=pobj_c->ppobj_StaticMethod[i]->dwAccess;
    275 
    276             bStatic=1;
    277         }
    278         else dwAccess=pobj_c->ppobj_Method[i]->dwAccess;
     267
     268        /////////////////////////////////
     269        // メソッド情報を取得
     270        /////////////////////////////////
     271        pMethod = pobj_c->GetMethodInfo( psi );
     272        if( !pMethod ){
     273            //動的メソッドが取得できなかったときは静的メソッドを当たる
     274            pMethod = pobj_c->GetStaticMethodInfo( psi );
     275            if( !pMethod ){
     276                SetError(300,NULL,cp);
     277                return -1;
     278            }
     279        }
    279280
    280281
     
    282283        // アクセスエラーチェック
    283284        //////////////////////////////
     285        DWORD dwAccess = pMethod->dwAccess;
    284286
    285287        if(ObjectName[0]){
     
    408410            else{
    409411                RELATIVE_VAR RelativeVar;
    410                 if(!GetVarOffsetReadOnly(ObjectName,&i2,&RelativeVar,0)) return -1;
     412                if( pMethod->isConst ){
     413                    //Constアクセスが可能なメソッドの場合
     414                    if( !GetVarOffsetReadOnly( ObjectName, &i2, &RelativeVar, 0 ) ) return -1;
     415                }
     416                else{
     417                    //Constアクセスが不可能なメソッドの場合
     418                    if( !GetVarOffsetReadWrite( ObjectName, &i2, &RelativeVar, 0 ) ) return -1;
     419                }
     420
    411421                SetVarPtrToReg(REG_RCX,&RelativeVar);
    412422
Note: See TracChangeset for help on using the changeset viewer.