Changeset 120 in dev for BasicCompiler32/Compile_Var.cpp


Ignore:
Timestamp:
May 13, 2007, 8:50:04 AM (17 years ago)
Author:
dai_9181
Message:

Parameter::Equals静的メソッドを廃止し、Parameters::Equalsメソッドを用意。
ポインタに要するサイズよりも一回り大きなアラインメントが指定されているときに、呼び出し側のオフセットズレを考慮するよう、修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/Compile_Var.cpp

    r116 r120  
    11041104        if( pVar->IsStruct() ){
    11051105            int alignment = pVar->GetClass().iAlign;
     1106
    11061107            if( alignment ){
    11071108                if( AllLocalVarSize % alignment ){
    11081109                    AllLocalVarSize += alignment - (AllLocalVarSize % alignment);
     1110                }
     1111            }
     1112
     1113            if( alignment == PTR_SIZE*2 ){
     1114                // ポインタに要するサイズよりも一回り大きなアラインメントが指定されているとき
     1115                // (例:CONTEXT構造体など)
     1116                // 呼び出し側のオフセットズレを考慮する
     1117
     1118                if( 0 == ( UserProc::CompilingUserProc().RealParams().GetMemorySize() + PTR_SIZE/*ret分*/ ) % alignment ){
     1119                    AllLocalVarSize += PTR_SIZE;
    11091120                }
    11101121            }
Note: See TracChangeset for help on using the changeset viewer.