Quellcode durchsuchen

* Consider conversion from integer to integer te_equal, if the base types
are equal and the range of the from type fits in the to type. I.e.
conversion from -10..10 to shortint is considered equal. This is correct
because in this case, the from type can be used wherever the to type is
used, i.e. the compiler never needs to do conversion at compile or run
time.

git-svn-id: trunk@7814 -

daniel vor 18 Jahren
Ursprung
Commit
504d845e86
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      compiler/defcmp.pas

+ 2 - 2
compiler/defcmp.pas

@@ -225,8 +225,8 @@ implementation
                           u8bit,u16bit,u32bit,u64bit,
                           u8bit,u16bit,u32bit,u64bit,
                           s8bit,s16bit,s32bit,s64bit:
                           s8bit,s16bit,s32bit,s64bit:
                             begin
                             begin
-                              if (torddef(def_from).low=torddef(def_to).low) and
-                                 (torddef(def_from).high=torddef(def_to).high) then
+                              if (torddef(def_from).low>=torddef(def_to).low) and
+                                 (torddef(def_from).high<=torddef(def_to).high) then
                                 eq:=te_equal
                                 eq:=te_equal
                               else
                               else
                                 begin
                                 begin