Changeset 435 in dev for trunk/abdev/BasicCompiler32/OperatorProc.cpp
- Timestamp:
- Mar 15, 2008, 1:20:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/OperatorProc.cpp
r424 r435 26 26 } 27 27 28 int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack, LONG_PTR *index_stack, BOOL *bUseHeap,int &sp)28 int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack, LONG_PTR *index_stack,bool isNeedHeapFreeStructureStack[],int &sp) 29 29 { 30 30 Type leftType( type_stack[sp-2], index_stack[sp-2] ); … … 95 95 if( pUserProc->RealParams()[1]->IsStruct() &&pUserProc->RealParams()[1]->IsRef() == false ){ 96 96 //一時オブジェクトはメソッド内で破棄される 97 bUseHeap[sp-1]=0;97 isNeedHeapFreeStructureStack[sp-1] = false; 98 98 } 99 99 } … … 140 140 141 141 //ヒープ解放用に退避 142 if( bUseHeap[sp-1]){142 if(isNeedHeapFreeStructureStack[sp-1]){ 143 143 //mov esi,eax 144 144 compiler.codeGenerator.op_mov_RR(REG_ESI,REG_EAX); 145 145 } 146 if( bUseHeap[sp-2]){146 if(isNeedHeapFreeStructureStack[sp-2]){ 147 147 //mov edi,ecx 148 148 compiler.codeGenerator.op_mov_RR(REG_EDI,REG_ECX); … … 198 198 } 199 199 200 if( bUseHeap[sp-1]){200 if(isNeedHeapFreeStructureStack[sp-1]){ 201 201 FreeTempObject(REG_ESI,(CClass *)index_stack[sp-1]); 202 202 } 203 if( bUseHeap[sp-2]){203 if(isNeedHeapFreeStructureStack[sp-2]){ 204 204 FreeTempObject(REG_EDI,(CClass *)index_stack[sp-2]); 205 205 } … … 209 209 index_stack[sp-1]=pUserProc->ReturnType().GetIndex(); 210 210 211 if( pUserProc->ReturnType().IsStruct() ){ 211 if( pUserProc->ReturnType().IsStruct() ) 212 { 212 213 //構造体が戻ったときはヒープ領域にインスタンスが格納されている 213 214 //※後にfreeする必要あり 214 bUseHeap[sp-1]=1; 215 } 216 else bUseHeap[sp-1]=0; 215 isNeedHeapFreeStructureStack[sp-1] = true; 216 } 217 else 218 { 219 isNeedHeapFreeStructureStack[sp-1] = false; 220 } 217 221 218 222 return 1; … … 222 226 int type_stack[10]; 223 227 LONG_PTR index_stack[10]; 224 BOOLarray_bUseHeap[10];228 bool array_bUseHeap[10]; 225 229 int sp=2; 226 230
Note:
See TracChangeset
for help on using the changeset viewer.