Ignore:
Timestamp:
Nov 11, 2007, 5:15:30 PM (16 years ago)
Author:
dai_9181
Message:

32ビットコンパイラでグローバル領域のTryスコープが正常にコンパイルできないバグを修正。
Catch、Finally節を持たないTryスコープを警告の対象とした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/src/Exception.cpp

    r364 r365  
    3838class TryScope
    3939{
     40    int sourceCodePos;
    4041    bool isDefinedFinally;
    4142
     
    6162
    6263public:
    63     TryScope()
    64         : isDefinedFinally( false )
     64    TryScope( int sourceCodePos )
     65        : sourceCodePos( sourceCodePos )
     66        , isDefinedFinally( false )
    6567    {
    6668    }
     
    6971    }
    7072
     73    int GetSourceCodePos() const
     74    {
     75        return sourceCodePos;
     76    }
    7177    const CatchScopes &GetCatchScopes() const
    7278    {
     
    237243void TryCommand()
    238244{
    239     tryScopes.push_back( TryScope() );
     245    tryScopes.push_back( TryScope( cp ) );
    240246    tryScopes.back().Try();
    241247
     
    315321        SetError(1,NULL,cp);
    316322        return;
     323    }
     324
     325    if( !tryScopes.back().IsDefinedFinally() && !tryScopes.back().IsCatched() )
     326    {
     327        // CatchもFinallyも存在しないとき
     328        SetError(-108,NULL,tryScopes.back().GetSourceCodePos() );
    317329    }
    318330
Note: See TracChangeset for help on using the changeset viewer.