Browse Source

* expectloc fixes

peter 22 years ago
parent
commit
41dfcfba39
2 changed files with 27 additions and 11 deletions
  1. 8 2
      compiler/nadd.pas
  2. 19 9
      compiler/ncnv.pas

+ 8 - 2
compiler/nadd.pas

@@ -1687,7 +1687,10 @@ implementation
            begin
            begin
              if tsetdef(ld).settype=smallset then
              if tsetdef(ld).settype=smallset then
               begin
               begin
-                 expectloc:=LOC_REGISTER;
+                 if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
+                  expectloc:=LOC_FLAGS
+                 else
+                  expectloc:=LOC_REGISTER;
                  { are we adding set elements ? }
                  { are we adding set elements ? }
                  if right.nodetype=setelementn then
                  if right.nodetype=setelementn then
                    calcregisters(self,2,0,0)
                    calcregisters(self,2,0,0)
@@ -1914,7 +1917,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.82  2003-04-22 23:50:22  peter
+  Revision 1.83  2003-04-23 10:10:07  peter
+    * expectloc fixes
+
+  Revision 1.82  2003/04/22 23:50:22  peter
     * firstpass uses expectloc
     * firstpass uses expectloc
     * checks if there are differences between the expectloc and
     * checks if there are differences between the expectloc and
       location.loc from secondpass in EXTDEBUG
       location.loc from secondpass in EXTDEBUG

+ 19 - 9
compiler/ncnv.pas

@@ -1345,8 +1345,7 @@ implementation
 
 
       begin
       begin
          first_string_to_chararray:=nil;
          first_string_to_chararray:=nil;
-         registers32:=1;
-         expectloc:=LOC_REGISTER;
+         expectloc:=left.expectloc;
       end;
       end;
 
 
 
 
@@ -1517,12 +1516,20 @@ implementation
     function ttypeconvnode.first_proc_to_procvar : tnode;
     function ttypeconvnode.first_proc_to_procvar : tnode;
       begin
       begin
          first_proc_to_procvar:=nil;
          first_proc_to_procvar:=nil;
-         if (left.expectloc<>LOC_REFERENCE) then
-           CGMessage(cg_e_illegal_expression);
-         registers32:=left.registers32;
-         if registers32<1 then
-           registers32:=1;
-         expectloc:=LOC_REGISTER;
+         if assigned(tunarynode(left).left) then
+          begin
+            if (left.expectloc<>LOC_CREFERENCE) then
+              CGMessage(cg_e_illegal_expression);
+            registers32:=left.registers32;
+            expectloc:=left.expectloc
+          end
+         else
+          begin
+            registers32:=left.registers32;
+            if registers32<1 then
+              registers32:=1;
+            expectloc:=LOC_REGISTER;
+          end
       end;
       end;
 
 
 
 
@@ -2027,7 +2034,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.105  2003-04-22 23:50:23  peter
+  Revision 1.106  2003-04-23 10:10:07  peter
+    * expectloc fixes
+
+  Revision 1.105  2003/04/22 23:50:23  peter
     * firstpass uses expectloc
     * firstpass uses expectloc
     * checks if there are differences between the expectloc and
     * checks if there are differences between the expectloc and
       location.loc from secondpass in EXTDEBUG
       location.loc from secondpass in EXTDEBUG