Changeset 66 in dev for BasicCompiler64/CParameter.cpp
- Timestamp:
- Mar 9, 2007, 4:59:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/CParameter.cpp
r64 r66 62 62 int type = NumOpe( ®, Parms[i2], DummyTypeInfo.type, DummyTypeInfo.u.lpIndex, &lpVarIndex ); 63 63 64 if( type == DEF_OBJECT ){64 if( type != DEF_STRUCT ){ 65 65 //一時参照を作成 66 66 pobj_sf->push( reg ); … … 115 115 op_call(pSub_free); 116 116 } 117 else if( types[i2].type == DEF_OBJECT ){117 else{ 118 118 pobj_sf->pop(); 119 119 pobj_sf->pop(); 120 }121 else{122 SetError(300,NULL,cp);123 120 } 124 121 } … … 423 420 } 424 421 else{ 425 //変数のアドレスを取得 426 int VarType; 427 LONG_PTR lpVarIndex; 428 if(GetVarOffset( 429 false, 430 false, 431 Parms[i2], 432 &VarType, 433 &RelativeVar, 434 &lpVarIndex)){ 435 436 if(DummyTypeInfo.type!=DEF_ANY){ 437 //型チェックを行う 438 if(DummyTypeInfo.type==VarType){ 439 if(DummyTypeInfo.type==DEF_OBJECT){ 440 if( !DummyTypeInfo.u.pobj_Class->IsEqualsOrSubClass( (CClass *)lpVarIndex ) ){ 441 SetError(11,Parms[i2],cp); 422 if( useTempParameters[i2] ){ 423 //一時オブジェクトをコピー 424 425 //mov reg, qword ptr[rsp+offset] 426 pobj_sf->ref_offset_data( reg, StackOffsetOfTempObject[i2] ); 427 } 428 else{ 429 //変数のアドレスを取得 430 int VarType; 431 LONG_PTR lpVarIndex; 432 if(GetVarOffset( 433 false, 434 false, 435 Parms[i2], 436 &VarType, 437 &RelativeVar, 438 &lpVarIndex)){ 439 440 if(DummyTypeInfo.type!=DEF_ANY){ 441 //型チェックを行う 442 if(DummyTypeInfo.type==VarType){ 443 if(DummyTypeInfo.type==DEF_OBJECT){ 444 if( !DummyTypeInfo.u.pobj_Class->IsEqualsOrSubClass( (CClass *)lpVarIndex ) ){ 445 SetError(11,Parms[i2],cp); 446 } 447 } 448 else if(DummyTypeInfo.type==DEF_STRUCT){ 449 if( !DummyTypeInfo.u.pobj_Class->IsEquals( (CClass *)lpVarIndex ) ){ 450 SetError(11,Parms[i2],cp); 451 } 442 452 } 443 453 } 444 else if(DummyTypeInfo.type==DEF_STRUCT){ 445 if( !DummyTypeInfo.u.pobj_Class->IsEquals( (CClass *)lpVarIndex ) ){ 446 SetError(11,Parms[i2],cp); 447 } 454 else if((VarType&FLAG_PTR)&&((VarType^FLAG_PTR)==DummyTypeInfo.type)){ 455 //仮引数がポインタ参照で、実引数が配列の先頭ポインタのとき 456 } 457 else{ 458 SetError(11,Parms[i2],cp); 448 459 } 449 460 } 450 else if((VarType&FLAG_PTR)&&((VarType^FLAG_PTR)==DummyTypeInfo.type)){ 451 //仮引数がポインタ参照で、実引数が配列の先頭ポインタのとき 452 } 453 else{ 454 SetError(11,Parms[i2],cp); 455 } 456 } 457 458 //変数アドレスをレジスタにセット 459 SetVarPtrToReg(reg,&RelativeVar); 460 461 } 462 else{ 463 //一時オブジェクトをコピー 464 465 //mov reg, qword ptr[rsp+offset] 466 pobj_sf->ref_offset_data( reg, StackOffsetOfTempObject[i2] ); 467 468 //VarType = NumOpe( ®, Parms[i2], DummyTypeInfo.type, DummyTypeInfo.u.lpIndex, &lpVarIndex ); 461 462 //変数アドレスをレジスタにセット 463 SetVarPtrToReg(reg,&RelativeVar); 464 465 } 469 466 } 470 467 }
Note:
See TracChangeset
for help on using the changeset viewer.