Browse Source

* fix rangecheck error when assigning u32bit=s32bit

peter 21 years ago
parent
commit
2240dfda57
1 changed files with 5 additions and 2 deletions
  1. 5 2
      compiler/cgobj.pas

+ 5 - 2
compiler/cgobj.pas

@@ -1860,7 +1860,7 @@ implementation
                  { from is signed and to is unsigned -> when looking at to }
                  { from is signed and to is unsigned -> when looking at to }
                  { as an signed value, it must be < maxaint (otherwise     }
                  { as an signed value, it must be < maxaint (otherwise     }
                  { it will become negative, which is invalid since "to" is unsigned) }
                  { it will become negative, which is invalid since "to" is unsigned) }
-                 if hto < 0 then
+                 if hto > aintmax then
                    hto := aintmax;
                    hto := aintmax;
                end
                end
              else
              else
@@ -2174,7 +2174,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.166  2004-06-20 08:55:28  florian
+  Revision 1.167  2004-07-03 11:47:04  peter
+    * fix rangecheck error when assigning u32bit=s32bit
+
+  Revision 1.166  2004/06/20 08:55:28  florian
     * logs truncated
     * logs truncated
 
 
   Revision 1.165  2004/06/16 20:07:07  florian
   Revision 1.165  2004/06/16 20:07:07  florian