mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 02:51:37 +01:00 
			
		
		
		
	* fixed instances of passing properties as var parameter
git-svn-id: trunk@7249 -
This commit is contained in:
		
							parent
							
								
									5fc31d96e0
								
							
						
					
					
						commit
						21f87ef1de
					
				| @ -169,7 +169,6 @@ interface | |||||||
|           function docompare(p: tnode): boolean; override; |           function docompare(p: tnode): boolean; override; | ||||||
|           procedure printnodetree(var t:text);override; |           procedure printnodetree(var t:text);override; | ||||||
| 
 | 
 | ||||||
|           property value : tnode read left write left; |  | ||||||
|           property nextpara : tnode read right write right; |           property nextpara : tnode read right write right; | ||||||
|           property parametername : tnode read third write third; |           property parametername : tnode read third write third; | ||||||
|        end; |        end; | ||||||
| @ -267,9 +266,9 @@ implementation | |||||||
|       procedure increase_paramssize; |       procedure increase_paramssize; | ||||||
|         begin |         begin | ||||||
|           { for now we pass everything by reference |           { for now we pass everything by reference | ||||||
|           case para.value.resultdef.typ of |           case para.left.resultdef.typ of | ||||||
|             variantdef: |             variantdef: | ||||||
|               inc(paramssize,para.value.resultdef.size); |               inc(paramssize,para.left.resultdef.size); | ||||||
|             else |             else | ||||||
|           } |           } | ||||||
|               inc(paramssize,sizeof(voidpointertype.size )); |               inc(paramssize,sizeof(voidpointertype.size )); | ||||||
| @ -301,41 +300,41 @@ implementation | |||||||
|         while assigned(para) do |         while assigned(para) do | ||||||
|           begin |           begin | ||||||
|             inc(paracount); |             inc(paracount); | ||||||
|             typecheckpass(para.value); |             typecheckpass(para.left); | ||||||
| 
 | 
 | ||||||
|             { insert some extra casts } |             { insert some extra casts } | ||||||
|             if is_constintnode(para.value) and not(is_64bitint(para.value.resultdef)) then |             if is_constintnode(para.left) and not(is_64bitint(para.left.resultdef)) then | ||||||
|               begin |               begin | ||||||
|                 para.value:=ctypeconvnode.create_internal(para.value,s32inttype); |                 para.left:=ctypeconvnode.create_internal(para.left,s32inttype); | ||||||
|                 typecheckpass(para.value); |                 typecheckpass(para.left); | ||||||
|               end |               end | ||||||
|             else if para.value.nodetype=stringconstn then |             else if para.left.nodetype=stringconstn then | ||||||
|               begin |               begin | ||||||
|                 para.value:=ctypeconvnode.create_internal(para.value,cwidestringtype); |                 para.left:=ctypeconvnode.create_internal(para.left,cwidestringtype); | ||||||
|                 typecheckpass(para.value); |                 typecheckpass(para.left); | ||||||
|               end |               end | ||||||
|             { force automatable boolean type } |             { force automatable boolean type } | ||||||
|             else if is_boolean(para.value.resultdef) then |             else if is_boolean(para.left.resultdef) then | ||||||
|               begin |               begin | ||||||
|                 para.value:=ctypeconvnode.create_internal(para.value,bool16type); |                 para.left:=ctypeconvnode.create_internal(para.left,bool16type); | ||||||
|                 typecheckpass(para.value); |                 typecheckpass(para.left); | ||||||
|               end |               end | ||||||
|             { force automatable float type } |             { force automatable float type } | ||||||
|             else if is_extended(para.value.resultdef) then |             else if is_extended(para.left.resultdef) then | ||||||
|               begin |               begin | ||||||
|                 para.value:=ctypeconvnode.create_internal(para.value,s64floattype); |                 para.left:=ctypeconvnode.create_internal(para.left,s64floattype); | ||||||
|                 typecheckpass(para.value); |                 typecheckpass(para.left); | ||||||
|               end; |               end; | ||||||
| 
 | 
 | ||||||
|             if assigned(para.parametername) then |             if assigned(para.parametername) then | ||||||
|               begin |               begin | ||||||
|                 typecheckpass(para.value); |                 typecheckpass(para.left); | ||||||
|                 inc(namedparacount); |                 inc(namedparacount); | ||||||
|               end; |               end; | ||||||
| 
 | 
 | ||||||
|             if para.value.nodetype<>nothingn then |             if para.left.nodetype<>nothingn then | ||||||
|               if not is_automatable(para.value.resultdef) then |               if not is_automatable(para.left.resultdef) then | ||||||
|                 CGMessagePos1(para.value.fileinfo,type_e_not_automatable,para.value.resultdef.typename); |                 CGMessagePos1(para.left.fileinfo,type_e_not_automatable,para.left.resultdef.typename); | ||||||
| 
 | 
 | ||||||
|             { we've to know the parameter size to allocate the temp. space } |             { we've to know the parameter size to allocate the temp. space } | ||||||
|             increase_paramssize; |             increase_paramssize; | ||||||
| @ -370,20 +369,20 @@ implementation | |||||||
|                   internalerror(200611041); |                   internalerror(200611041); | ||||||
|               end; |               end; | ||||||
| 
 | 
 | ||||||
|             dispatchbyref:=para.value.resultdef.typ in [variantdef]; |             dispatchbyref:=para.left.resultdef.typ in [variantdef]; | ||||||
|             { assign the argument/parameter to the temporary location } |             { assign the argument/parameter to the temporary location } | ||||||
| 
 | 
 | ||||||
|             if para.value.nodetype<>nothingn then |             if para.left.nodetype<>nothingn then | ||||||
|               if dispatchbyref then |               if dispatchbyref then | ||||||
|                 addstatement(statements,cassignmentnode.create( |                 addstatement(statements,cassignmentnode.create( | ||||||
|                   ctypeconvnode.create_internal(cderefnode.create(caddnode.create(addn, |                   ctypeconvnode.create_internal(cderefnode.create(caddnode.create(addn, | ||||||
|                     caddrnode.create(ctemprefnode.create(params)), |                     caddrnode.create(ctemprefnode.create(params)), | ||||||
|                     cordconstnode.create(paramssize,ptruinttype,false) |                     cordconstnode.create(paramssize,ptruinttype,false) | ||||||
|                   )),voidpointertype), |                   )),voidpointertype), | ||||||
|                   ctypeconvnode.create_internal(caddrnode.create_internal(para.value),voidpointertype))) |                   ctypeconvnode.create_internal(caddrnode.create_internal(para.left),voidpointertype))) | ||||||
|               else |               else | ||||||
|                 begin |                 begin | ||||||
|                   case para.value.resultdef.size of |                   case para.left.resultdef.size of | ||||||
|                     1..4: |                     1..4: | ||||||
|                       assignmenttype:=u32inttype; |                       assignmenttype:=u32inttype; | ||||||
|                     8: |                     8: | ||||||
| @ -396,20 +395,20 @@ implementation | |||||||
|                       caddrnode.create(ctemprefnode.create(params)), |                       caddrnode.create(ctemprefnode.create(params)), | ||||||
|                       cordconstnode.create(paramssize,ptruinttype,false) |                       cordconstnode.create(paramssize,ptruinttype,false) | ||||||
|                     )),assignmenttype), |                     )),assignmenttype), | ||||||
|                     ctypeconvnode.create_internal(para.value,assignmenttype))); |                     ctypeconvnode.create_internal(para.left,assignmenttype))); | ||||||
|                 end; |                 end; | ||||||
| 
 | 
 | ||||||
|             if is_ansistring(para.value.resultdef) then |             if is_ansistring(para.left.resultdef) then | ||||||
|               calldesc.argtypes[currargpos]:=varStrArg |               calldesc.argtypes[currargpos]:=varStrArg | ||||||
|             else |             else | ||||||
|               calldesc.argtypes[currargpos]:=para.value.resultdef.getvardef; |               calldesc.argtypes[currargpos]:=para.left.resultdef.getvardef; | ||||||
| 
 | 
 | ||||||
|             if dispatchbyref then |             if dispatchbyref then | ||||||
|               calldesc.argtypes[currargpos]:=calldesc.argtypes[currargpos] or $80; |               calldesc.argtypes[currargpos]:=calldesc.argtypes[currargpos] or $80; | ||||||
| 
 | 
 | ||||||
|             increase_paramssize; |             increase_paramssize; | ||||||
| 
 | 
 | ||||||
|             para.value:=nil; |             para.left:=nil; | ||||||
|             inc(currargpos); |             inc(currargpos); | ||||||
|             para:=tcallparanode(para.nextpara); |             para:=tcallparanode(para.nextpara); | ||||||
|           end; |           end; | ||||||
|  | |||||||
| @ -893,8 +893,9 @@ implementation | |||||||
|               { multiple parameters? } |               { multiple parameters? } | ||||||
|               if assigned(right) then |               if assigned(right) then | ||||||
|                 begin |                 begin | ||||||
|                   if assigned(frametree) then |                   { frame tree } | ||||||
|                     secondpass(frametree); |                   if assigned(third) then | ||||||
|  |                     secondpass(third); | ||||||
|                   secondpass(right); |                   secondpass(right); | ||||||
|                 end; |                 end; | ||||||
|               secondpass(left); |               secondpass(left); | ||||||
| @ -905,8 +906,9 @@ implementation | |||||||
|               if assigned(right) then |               if assigned(right) then | ||||||
|                 begin |                 begin | ||||||
|                   paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc3); |                   paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc3); | ||||||
|                   if assigned(frametree) then |                   { frame tree } | ||||||
|                     cg.a_param_loc(current_asmdata.CurrAsmList,frametree.location,paraloc3) |                   if assigned(third) then | ||||||
|  |                     cg.a_param_loc(current_asmdata.CurrAsmList,third.location,paraloc3) | ||||||
|                   else |                   else | ||||||
|                     cg.a_param_const(current_asmdata.CurrAsmList,OS_INT,0,paraloc3); |                     cg.a_param_const(current_asmdata.CurrAsmList,OS_INT,0,paraloc3); | ||||||
|                   { push address } |                   { push address } | ||||||
|  | |||||||
| @ -169,8 +169,6 @@ interface | |||||||
|           constructor create(l,taddr,tframe:tnode);virtual; |           constructor create(l,taddr,tframe:tnode);virtual; | ||||||
|           function pass_typecheck:tnode;override; |           function pass_typecheck:tnode;override; | ||||||
|           function pass_1 : tnode;override; |           function pass_1 : tnode;override; | ||||||
| 
 |  | ||||||
|           property frametree : tnode read third write third; |  | ||||||
|        end; |        end; | ||||||
|        traisenodeclass = class of traisenode; |        traisenodeclass = class of traisenode; | ||||||
| 
 | 
 | ||||||
| @ -1258,10 +1256,10 @@ implementation | |||||||
|                  typecheckpass(right); |                  typecheckpass(right); | ||||||
|                  inserttypeconv(right,voidpointertype); |                  inserttypeconv(right,voidpointertype); | ||||||
|                  { frame } |                  { frame } | ||||||
|                  if assigned(frametree) then |                  if assigned(third) then | ||||||
|                   begin |                   begin | ||||||
|                     typecheckpass(frametree); |                     typecheckpass(third); | ||||||
|                     inserttypeconv(frametree,voidpointertype); |                     inserttypeconv(third,voidpointertype); | ||||||
|                   end; |                   end; | ||||||
|                end; |                end; | ||||||
|            end; |            end; | ||||||
| @ -1283,8 +1281,8 @@ implementation | |||||||
|                  { addr } |                  { addr } | ||||||
|                  firstpass(right); |                  firstpass(right); | ||||||
|                  { frame } |                  { frame } | ||||||
|                  if assigned(frametree) then |                  if assigned(third) then | ||||||
|                   firstpass(frametree); |                   firstpass(third); | ||||||
|                end; |                end; | ||||||
|               left_right_max; |               left_right_max; | ||||||
|            end; |            end; | ||||||
|  | |||||||
| @ -659,7 +659,7 @@ implementation | |||||||
|                   begin |                   begin | ||||||
|                     datasize:=align(datasize,sizeof(aint)); |                     datasize:=align(datasize,sizeof(aint)); | ||||||
|                     ImplIntf.Ioffset:=datasize; |                     ImplIntf.Ioffset:=datasize; | ||||||
|                     inc(datasize,sizeof(aint)); |                     datasize:=datasize+sizeof(aint); | ||||||
|                   end; |                   end; | ||||||
|               end; |               end; | ||||||
|           end; |           end; | ||||||
|  | |||||||
| @ -132,7 +132,8 @@ implementation | |||||||
|             result := foreachnode(tloopnode(n).t2,f,arg) or result; |             result := foreachnode(tloopnode(n).t2,f,arg) or result; | ||||||
|           end; |           end; | ||||||
|         raisen: |         raisen: | ||||||
|           result := foreachnode(traisenode(n).frametree,f,arg) or result; |           { frame tree } | ||||||
|  |           result := foreachnode(traisenode(n).third,f,arg) or result; | ||||||
|         casen: |         casen: | ||||||
|           begin |           begin | ||||||
|             for i := 0 to tcasenode(n).blocks.count-1 do |             for i := 0 to tcasenode(n).blocks.count-1 do | ||||||
| @ -179,7 +180,8 @@ implementation | |||||||
|               result := foreachnodestatic(procmethod,tloopnode(n).t2,f,arg) or result; |               result := foreachnodestatic(procmethod,tloopnode(n).t2,f,arg) or result; | ||||||
|             end; |             end; | ||||||
|           raisen: |           raisen: | ||||||
|             result := foreachnodestatic(traisenode(n).frametree,f,arg) or result; |             { frame tree } | ||||||
|  |             result := foreachnodestatic(traisenode(n).third,f,arg) or result; | ||||||
|           casen: |           casen: | ||||||
|             begin |             begin | ||||||
|               for i := 0 to tcasenode(n).blocks.count-1 do |               for i := 0 to tcasenode(n).blocks.count-1 do | ||||||
|  | |||||||
| @ -406,8 +406,6 @@ interface | |||||||
|         FObjDataList  : TFPObjectList; |         FObjDataList  : TFPObjectList; | ||||||
|         { Position calculation } |         { Position calculation } | ||||||
|         FImageBase    : aint; |         FImageBase    : aint; | ||||||
|         FCurrDataPos, |  | ||||||
|         FCurrMemPos   : aint; |  | ||||||
|       protected |       protected | ||||||
|         { writer } |         { writer } | ||||||
|         FWriter : TObjectwriter; |         FWriter : TObjectwriter; | ||||||
| @ -420,6 +418,8 @@ interface | |||||||
|         property CExeSection:TExeSectionClass read FCExeSection write FCExeSection; |         property CExeSection:TExeSectionClass read FCExeSection write FCExeSection; | ||||||
|         property CObjData:TObjDataClass read FCObjData write FCObjData; |         property CObjData:TObjDataClass read FCObjData write FCObjData; | ||||||
|       public |       public | ||||||
|  |         CurrDataPos, | ||||||
|  |         CurrMemPos   : aint; | ||||||
|         IsSharedLibrary : boolean; |         IsSharedLibrary : boolean; | ||||||
|         constructor create;virtual; |         constructor create;virtual; | ||||||
|         destructor  destroy;override; |         destructor  destroy;override; | ||||||
| @ -467,8 +467,6 @@ interface | |||||||
|         property EntryName:string read FEntryName write FEntryName; |         property EntryName:string read FEntryName write FEntryName; | ||||||
|         property ImageBase:aint read FImageBase write FImageBase; |         property ImageBase:aint read FImageBase write FImageBase; | ||||||
|         property CurrExeSec:TExeSection read FCurrExeSec; |         property CurrExeSec:TExeSection read FCurrExeSec; | ||||||
|         property CurrDataPos:aint read FCurrDataPos write FCurrDataPos; |  | ||||||
|         property CurrMemPos:aint read FCurrMemPos write FCurrMemPos; |  | ||||||
|       end; |       end; | ||||||
|       TExeOutputClass=class of TExeOutput; |       TExeOutputClass=class of TExeOutput; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -38,16 +38,12 @@ type | |||||||
| 
 | 
 | ||||||
|   TSuiteResults = class(TObject) |   TSuiteResults = class(TObject) | ||||||
|   private |   private | ||||||
|     FRuns: integer; |  | ||||||
|     FErrors: integer; |  | ||||||
|     FFailures: integer; |  | ||||||
|     FIgnores: integer; |  | ||||||
|     FStartTime: TDateTime; |     FStartTime: TDateTime; | ||||||
|   public |   public | ||||||
|     property Runs: integer read FRuns write FRuns; |     Runs: integer; | ||||||
|     property Ignores: integer read FIgnores write FIgnores; |     Failures: integer; | ||||||
|     property Errors: integer read FErrors write FErrors; |     Errors: integer; | ||||||
|     property Failures: integer read FFailures write FFailures; |     Ignores: integer; | ||||||
|     property StartTime: TDateTime read FStartTime write FStartTime; |     property StartTime: TDateTime read FStartTime write FStartTime; | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jonas Maebe
						Jonas Maebe