mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 00:31:29 +01:00 
			
		
		
		
	* don't pre-finalize temp nodes that are passed by reference as hidden
function result parameter, because reference counted function results
    are not guaranteed to be initialized (we sometimes even pass the,
    non-finalized, left-hand side of an assignment as hidden function
    result parameter)
git-svn-id: trunk@21955 -
			
			
This commit is contained in:
		
							parent
							
								
									ba4b08261c
								
							
						
					
					
						commit
						ccbcb36f98
					
				| @ -405,8 +405,10 @@ interface | ||||
|                 location_reset_ref(tempinfo^.location,LOC_REFERENCE,def_cgsize(tempinfo^.typedef),0); | ||||
|                 tg.gethltemptyped(current_asmdata.CurrAsmList,tempinfo^.typedef,tempinfo^.temptype,tempinfo^.location.reference); | ||||
|                 { the temp could have been used previously either because the memory location was reused or | ||||
|                   because we're in a loop } | ||||
|                 hlcg.g_finalize(current_asmdata.CurrAsmList,tempinfo^.typedef,tempinfo^.location.reference); | ||||
|                   because we're in a loop. In case it's used as a function result, that doesn't matter | ||||
|                   because it will be finalized when assigned to. } | ||||
|                 if not(nf_is_funcret in flags) then | ||||
|                   hlcg.g_finalize(current_asmdata.CurrAsmList,tempinfo^.typedef,tempinfo^.location.reference); | ||||
|               end | ||||
|             else if (ti_may_be_in_reg in tempinfo^.flags) then | ||||
|               begin | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jonas Maebe
						Jonas Maebe