Browse Source

+ also handle LOC_FLAGS in tz80notnode.second_boolean

git-svn-id: branches/z80@44993 -
nickysn 5 years ago
parent
commit
a3ae55081a
1 changed files with 17 additions and 1 deletions
  1. 17 1
      compiler/z80/nz80mat.pas

+ 17 - 1
compiler/z80/nz80mat.pas

@@ -58,7 +58,23 @@ implementation
     procedure tz80notnode.second_boolean;
     procedure tz80notnode.second_boolean;
       begin
       begin
         if not handle_locjump then
         if not handle_locjump then
-          internalerror(2020042208);
+          begin
+            { the second pass could change the location of left }
+            { if it is a register variable, so we've to do      }
+            { this before the case statement                    }
+            secondpass(left);
+
+            case left.location.loc of
+              LOC_FLAGS :
+                begin
+                  location_reset(location,LOC_FLAGS,OS_NO);
+                  location.resflags:=left.location.resflags;
+                  inverse_flags(location.resflags);
+                end;
+              else
+                internalerror(2020042208);
+            end;
+          end;
       end;
       end;