mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 11:39:40 +01:00 
			
		
		
		
	* m68k/n68kmat.pas, tm68knotnode.pass_generate_code:
It is a bad idea (TM) to do a second_pass twice on the same node * added test git-svn-id: trunk@22785 -
This commit is contained in:
		
							parent
							
								
									5bfca6634e
								
							
						
					
					
						commit
						72a01f17f5
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@ -9661,6 +9661,7 @@ tests/tbs/tb0581.pp svneol=native#text/plain
 | 
			
		||||
tests/tbs/tb0582.pp svneol=native#text/pascal
 | 
			
		||||
tests/tbs/tb0583.pp svneol=native#text/plain
 | 
			
		||||
tests/tbs/tb0583a.pp svneol=native#text/plain
 | 
			
		||||
tests/tbs/tb0584.pp svneol=native#text/pascal
 | 
			
		||||
tests/tbs/tb205.pp svneol=native#text/plain
 | 
			
		||||
tests/tbs/ub0060.pp svneol=native#text/plain
 | 
			
		||||
tests/tbs/ub0069.pp svneol=native#text/plain
 | 
			
		||||
 | 
			
		||||
@ -69,6 +69,7 @@ implementation
 | 
			
		||||
      var
 | 
			
		||||
         hl : tasmlabel;
 | 
			
		||||
         opsize : tcgsize;
 | 
			
		||||
         seconddone : boolean;
 | 
			
		||||
      begin
 | 
			
		||||
         opsize:=def_cgsize(resultdef);
 | 
			
		||||
         if is_boolean(resultdef) then
 | 
			
		||||
@ -77,7 +78,12 @@ implementation
 | 
			
		||||
            { if it is a register variable, so we've to do      }
 | 
			
		||||
            { this before the case statement                    }
 | 
			
		||||
            if left.location.loc<>LOC_JUMP then
 | 
			
		||||
             secondpass(left);
 | 
			
		||||
              begin
 | 
			
		||||
                secondpass(left);
 | 
			
		||||
                seconddone:=true;
 | 
			
		||||
              end
 | 
			
		||||
            else
 | 
			
		||||
              seconddone:=false;
 | 
			
		||||
 | 
			
		||||
            case left.location.loc of
 | 
			
		||||
              LOC_JUMP :
 | 
			
		||||
@ -86,7 +92,8 @@ implementation
 | 
			
		||||
                  hl:=current_procinfo.CurrTrueLabel;
 | 
			
		||||
                  current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
 | 
			
		||||
                  current_procinfo.CurrFalseLabel:=hl;
 | 
			
		||||
                  secondpass(left);
 | 
			
		||||
                  if not seconddone then
 | 
			
		||||
                    secondpass(left);
 | 
			
		||||
                  maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
 | 
			
		||||
                  hl:=current_procinfo.CurrTrueLabel;
 | 
			
		||||
                  current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										40
									
								
								tests/tbs/tb0584.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								tests/tbs/tb0584.pp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,40 @@
 | 
			
		||||
{ %NORUN }
 | 
			
		||||
 | 
			
		||||
program tb0584;
 | 
			
		||||
 | 
			
		||||
{$mode objfpc}
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
  TSomeObj = class
 | 
			
		||||
    function Test(s: String): TObject;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
  TSomeOtherObj = class
 | 
			
		||||
  public
 | 
			
		||||
    function GetFoo: String;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
function TSomeObj.Test(s: String): TObject;
 | 
			
		||||
begin
 | 
			
		||||
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TSomeOtherObj.GetFoo: String;
 | 
			
		||||
begin
 | 
			
		||||
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
var
 | 
			
		||||
  SomeObj: TSomeObj;
 | 
			
		||||
 | 
			
		||||
procedure Test;
 | 
			
		||||
var
 | 
			
		||||
  b: Boolean;
 | 
			
		||||
  obj: TSomeOtherObj;
 | 
			
		||||
begin
 | 
			
		||||
  b := not Assigned(SomeObj.Test(obj.GetFoo));
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
 | 
			
		||||
end.
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user