فهرست منبع

* 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 -

svenbarth 12 سال پیش
والد
کامیت
5bb0e5992b
3فایلهای تغییر یافته به همراه22 افزوده شده و 2 حذف شده
  1. 1 0
      .gitattributes
  2. 3 2
      compiler/m68k/n68kadd.pas
  3. 18 0
      tests/tbs/tb0586.pp

+ 1 - 0
.gitattributes

@@ -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

+ 3 - 2
compiler/m68k/n68kadd.pas

@@ -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 - 0
tests/tbs/tb0586.pp

@@ -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.