* m68k/n68kadd.pas, t68kaddnode.second_cmpboolean:

don't use "location.loc" if second_pass was not called on the node yet, but "expectloc"
* added test

git-svn-id: trunk@22789 -
This commit is contained in:
svenbarth 2012-10-20 20:32:46 +00:00
parent b6eac7a31b
commit 5bb0e5992b
3 changed files with 22 additions and 2 deletions

1
.gitattributes vendored
View File

@ -9663,6 +9663,7 @@ 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/tb0585.pp svneol=native#text/pascal
tests/tbs/tb0586.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

View File

@ -386,6 +386,7 @@ implementation
otl,ofl : tasmlabel;
begin
// writeln('second_cmpboolean');
{ ToDo : add support for pasbool64 and bool64bit }
if (torddef(left.resultdef).ordtype in [pasbool8,bool8bit]) or
(torddef(right.resultdef).ordtype in [pasbool8,bool8bit]) then
cgsize:=OS_8
@ -402,7 +403,7 @@ implementation
if left.nodetype in [ordconstn,realconstn] then
swapleftright;
isjump:=(left.location.loc=LOC_JUMP);
isjump:=(left.expectloc=LOC_JUMP);
if isjump then
begin
otl:=current_procinfo.CurrTrueLabel;
@ -422,7 +423,7 @@ implementation
current_procinfo.CurrFalseLabel:=ofl;
end;
isjump:=(right.location.loc=LOC_JUMP);
isjump:=(right.expectloc=LOC_JUMP);
if isjump then
begin
otl:=current_procinfo.CurrTrueLabel;

18
tests/tbs/tb0586.pp Normal file
View File

@ -0,0 +1,18 @@
{ %NORUN }
program tb0586;
{$mode objfpc}
procedure Test;
var
a, b: Boolean;
obj: TObject;
begin
if assigned(obj)<>(a=b) then
;
end;
begin
end.