Changeset 34 in dev for BasicCompiler32/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
  • BasicCompiler32/Compile_ProcOp.cpp

    r31 r34  
    8888        bCompilingGlobal=1;
    8989
    90         CallDestrouctorsOfScope();
     90        obj_LexScopes.CallDestructorsOfScopeEnd();
    9191
    9292        bCompilingGlobal=bBackCompilingGlobal;
     
    658658    }
    659659
    660     //プロシージャ抜け出しスケジュール(Exit Sub/Function)
    661     for(i3=0;i3<ExitSubScheduleNum;i3++){
    662         *((long *)(OpBuffer+pExitSubSchedule[i3]))=obp-(pExitSubSchedule[i3]+sizeof(long));
    663     }
    664     HeapDefaultFree(pExitSubSchedule);
    665 
    666     if(bDebugCompile&&bDebugSupportProc==0){
    667         *((long *)(OpBuffer+EspOffsetSchedule))=AllLocalVarSize-BaseOffset;
    668 
    669         //call _DebugSys_EndProc
    670         extern SUBINFO *pSub_DebugSys_EndProc;
    671         op_call(pSub_DebugSys_EndProc);
    672     }
    673 
    674660    //ラベル用のメモリを解放
    675661    for(i3=0;i3<MaxLabelNum;i3++){
     
    707693
    708694    //ローカルオブジェクトの解放処理
    709     CallDestrouctorsOfScope();
     695    obj_LexScopes.CallDestructorsOfScopeEnd();
     696
     697    //プロシージャ抜け出しスケジュール(Exit Sub/Function)
     698    for(i3=0;i3<ExitSubScheduleNum;i3++){
     699        *((long *)(OpBuffer+pExitSubSchedule[i3]))=obp-(pExitSubSchedule[i3]+sizeof(long));
     700    }
     701    HeapDefaultFree(pExitSubSchedule);
     702
     703    if(bDebugCompile&&bDebugSupportProc==0){
     704        *((long *)(OpBuffer+EspOffsetSchedule))=AllLocalVarSize-BaseOffset;
     705
     706        //call _DebugSys_EndProc
     707        extern SUBINFO *pSub_DebugSys_EndProc;
     708        op_call(pSub_DebugSys_EndProc);
     709    }
    710710
    711711    if(psi->ReturnType!=-1){
Note: See TracChangeset for help on using the changeset viewer.