Changeset 34 in dev for BasicCompiler64/Compile_ProcOp.cpp


Ignore:
Timestamp:
Jan 14, 2007, 6:11:23 AM (17 years ago)
Author:
dai_9181
Message:

スコープ処理を統一した。関数の途中でReturnしても、スコープにあるローカルオブジェクトを正確に破棄できるようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/Compile_ProcOp.cpp

    r31 r34  
    109109        bCompilingGlobal=1;
    110110
    111         CallDestrouctorsOfScope();
     111        obj_LexScopes.CallDestructorsOfScopeEnd();
    112112
    113113        bCompilingGlobal=bBackCompilingGlobal;
     
    700700    }
    701701
    702     //プロシージャ抜け出しスケジュール(Exit Sub/Function)
    703     for(i3=0;i3<ExitSubScheduleNum;i3++){
    704         *((long *)(OpBuffer+pExitSubSchedule[i3]))=obp-(pExitSubSchedule[i3]+sizeof(long));
    705     }
    706     HeapDefaultFree(pExitSubSchedule);
    707 
    708     if(bDebugCompile&&bDebugSupportProc==0){
    709         //call _DebugSys_EndProc
    710         extern SUBINFO *pSub_DebugSys_EndProc;
    711         op_call(pSub_DebugSys_EndProc);
    712     }
    713 
    714702    //ラベル用のメモリを解放
    715703    for(i3=0;i3<MaxLabelNum;i3++){
     
    744732
    745733    //ローカルオブジェクト(レキシカルスコープレベル=0)の解放処理
    746     CallDestrouctorsOfScope();
     734    obj_LexScopes.CallDestructorsOfScopeEnd();
     735
     736    //プロシージャ抜け出しスケジュール(Exit Sub/Function)
     737    for(i3=0;i3<ExitSubScheduleNum;i3++){
     738        *((long *)(OpBuffer+pExitSubSchedule[i3]))=obp-(pExitSubSchedule[i3]+sizeof(long));
     739    }
     740    HeapDefaultFree(pExitSubSchedule);
     741
     742    if(bDebugCompile&&bDebugSupportProc==0){
     743        //call _DebugSys_EndProc
     744        extern SUBINFO *pSub_DebugSys_EndProc;
     745        op_call(pSub_DebugSys_EndProc);
     746    }
    747747
    748748    if(psi->ReturnType!=-1){
Note: See TracChangeset for help on using the changeset viewer.