Ignore:
Timestamp:
Apr 14, 2007, 8:36:04 PM (17 years ago)
Author:
dai_9181
Message:

New[]を禁止した。
一部の動的型情報が生成されないバグを修正。
As演算子によるダウンキャストを許可(プログラム的なチェックはまだ走っていない)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/NumOpe_GetType.cpp

    r79 r94  
    309309    }
    310310
     311    if( expression[0] == '[' ){
     312        if( !baseType.IsPointer() ){
     313            SetError(1,NULL,cp);
     314            return false;
     315        }
     316
     317        resultType = baseType;
     318        return true;
     319    }
     320
    311321
    312322    /////////////////////////////////
     
    353363                    || isNothing_stack[sp-2] ){
    354364                        // 同一の型、またはNothingに対するAsはAs演算子を呼び出さない
     365                }
     366                else if( idCalc == CALC_AS
     367                    && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
     368                    && ( ((CClass *)index_stack[sp-1])->IsEqualsOrSubClass( (CClass *)index_stack[sp-2] ) || ((CClass *)index_stack[sp-2])->IsEqualsOrSubClass( (CClass *)index_stack[sp-1] )
     369                    )){
     370                        // ダウンキャストを許可する
    355371                }
    356372                else{
Note: See TracChangeset for help on using the changeset viewer.