Ignore:
Timestamp:
Jan 13, 2007, 4:26:50 AM (17 years ago)
Author:
dai_9181
Message:

_System_LocalThis(見えないThisポインタパラメータ)を通常のパラメータ保有領域ではなく、リアルパラメータ保有領域に移動した。
メソッドとグローバル関数のオーバーロードに対応(DLL関数オーバーロードには未対応)。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/Compile_CallProc.cpp

    r29 r31  
    6767
    6868
    69         ret_type=Opcode_CallProc(Parameter,psi,plpRetIndex,0,ObjectName,RefType);
     69        Opcode_CallProc(Parameter,psi,0,ObjectName,RefType);
     70        if( plpRetIndex ){
     71            *plpRetIndex = psi->u.ReturnIndex;
     72        }
     73        return psi->ReturnType;
    7074    }
    7175    else if(idProc==PROC_DLL){
     
    138142    if(psi){
    139143        //呼び出し
    140         int type;
    141         LONG_PTR lpIndex;
    142         type=Opcode_CallProc(Parameter,psi,&lpIndex,0,ObjectName,RefType);
     144        Opcode_CallProc(Parameter,psi,0,ObjectName,RefType);
    143145
    144146        if(pRetTypeInfo){
    145             pRetTypeInfo->type=type;
    146             pRetTypeInfo->u.lpIndex=lpIndex;
     147            pRetTypeInfo->type = psi->ReturnType;
     148            pRetTypeInfo->u.lpIndex = psi->u.ReturnIndex;
    147149        }
    148150    }
     
    174176
    175177    //エラーチェック
    176     pobj_parameter->ErrorCheck(variable,pi->pParmInfo,pi->ParmNum,pi->ParmNum);
     178    if( !pobj_parameter->ErrorCheck(variable,pi->pParmInfo,pi->ParmNum,pi->ParmNum) ){
     179        //パラメータにエラーがあるときは処理を終える
     180        return pi->ReturnType;
     181    }
    177182
    178183    //一時オブジェクトを生成
     
    213218}
    214219
    215 int Opcode_CallProc(char *Parameter,SUBINFO *psi,LONG_PTR *plpIndex,DWORD dwFlags,char *ObjectName,int RefType){
     220void Opcode_CallProc(char *Parameter,SUBINFO *psi,DWORD dwFlags,char *ObjectName,int RefType){
    216221    int i,i2;
    217222
     
    219224        if(lstrcmpi(psi->name,"Print")==0){
    220225            Opcode_Print(Parameter,0);
    221             return -1;
     226            return;
    222227        }
    223228        if(lstrcmpi(psi->name,"Input")==0){
    224229            Opcode_Input(Parameter);
    225             return -1;
     230            return;
    226231        }
    227232        if(lstrcmpi(psi->name,"Write")==0){
    228233            Opcode_Print(Parameter,1);
    229             return -1;
     234            return;
    230235        }
    231236    }
     
    277282            if( !pMethod ){
    278283                SetError(300,NULL,cp);
    279                 return -1;
     284                return;
    280285            }
    281286
     
    296301                if(dwAccess==ACCESS_NON){
    297302                    SetError(109,psi->name,cp);
    298                     return -1;
     303                    return;
    299304                }
    300305            }
     
    303308                    dwAccess==ACCESS_NON){
    304309                    SetError(109,psi->name,cp);
    305                     return -1;
     310                    return;
    306311                }
    307312                if(dwAccess==ACCESS_PROTECTED){
    308313                    SetError(110,psi->name,cp);
    309                     return -1;
     314                    return;
    310315                }
    311316            }
     
    315320            if(dwAccess==ACCESS_NON){
    316321                SetError(109,psi->name,cp);
    317                 return -1;
     322                return;
    318323            }
    319324        }
     
    352357
    353358    //エラーチェック
    354     pobj_parameter->ErrorCheck(psi->name,psi->pRealParmInfo,psi->RealParmNum,psi->RealSecondParmNum);
     359    if( !pobj_parameter->ErrorCheck(psi->name,psi->pRealParmInfo,psi->RealParmNum,psi->RealSecondParmNum) ){
     360        //パラメータにエラーがあるときは処理を終える
     361        return;
     362    }
    355363
    356364    if(psi->dwType==SUBTYPE_MACRO){
     
    401409                if( pMethod->isConst ){
    402410                    //Constアクセスが可能なメソッドの場合
    403                     if( !GetVarOffsetReadOnly( ObjectName, &i2, &RelativeVar, 0 ) ) return -1;
     411                    if( !GetVarOffsetReadOnly( ObjectName, &i2, &RelativeVar, 0 ) ) return;
    404412                }
    405413                else{
    406414                    //Constアクセスが不可能なメソッドの場合
    407                     if( !GetVarOffsetReadWrite( ObjectName, &i2, &RelativeVar, 0 ) ) return -1;
     415                    if( !GetVarOffsetReadWrite( ObjectName, &i2, &RelativeVar, 0 ) ) return;
    408416                }
    409417
     
    488496    //パラメータオブジェクトを破棄
    489497    delete pobj_parameter;
    490 
    491     if(plpIndex) *plpIndex=psi->u.ReturnIndex;
    492 
    493     return psi->ReturnType;
    494498}
    495499
     
    516520
    517521    //エラーチェック
    518     pobj_parameter->ErrorCheck(pdi->name,pdi->pParmInfo,pdi->ParmNum,pdi->ParmNum);
     522    if( !pobj_parameter->ErrorCheck(pdi->name,pdi->pParmInfo,pdi->ParmNum,pdi->ParmNum) ){
     523        //パラメータにエラーがあるときは処理を終える
     524        return pdi->ReturnType;
     525    }
    519526
    520527    //レジスタ、スタックフレームにセット
Note: See TracChangeset for help on using the changeset viewer.