Browse Source

* fixed bug in type conversions between enum subranges (it didn't take
the packenum directive into account)
+ define PACKENUMFIXED symbol in options.pas
(merged from fixes branch)

Jonas Maebe 25 years ago
parent
commit
cca5461149
2 changed files with 17 additions and 3 deletions
  1. 9 2
      compiler/htypechk.pas
  2. 8 1
      compiler/options.pas

+ 9 - 2
compiler/htypechk.pas

@@ -295,7 +295,8 @@ implementation
                   if (hd1=hd2) then
                   if (hd1=hd2) then
                     begin
                     begin
                        b:=1;
                        b:=1;
-                       doconv:=tc_equal;
+                       { because of packenum they can have different sizes! (JM) }
+                       doconv:=tc_int_2_int;
                     end;
                     end;
                 end;
                 end;
              end;
              end;
@@ -1131,7 +1132,13 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:41  michael
+  Revision 1.3  2000-08-07 11:31:04  jonas
+    * fixed bug in type conversions between enum subranges (it didn't take
+      the packenum directive into account)
+    + define PACKENUMFIXED symbol in options.pas
+     (merged from fixes branch)
+
+  Revision 1.2  2000/07/13 11:32:41  michael
   + removed logs
   + removed logs
 
 
 }
 }

+ 8 - 1
compiler/options.pas

@@ -1224,6 +1224,7 @@ begin
 { for the RTL }
 { for the RTL }
   def_symbol('CARDINALMULFIXED');
   def_symbol('CARDINALMULFIXED');
 {$endif cardinalmulfix}
 {$endif cardinalmulfix}
+  def_symbol('PACKENUMFIXED');
 
 
 { New since 1.09 }
 { New since 1.09 }
   def_symbol('HASOUT');
   def_symbol('HASOUT');
@@ -1480,7 +1481,13 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2000-07-14 05:11:48  michael
+  Revision 1.5  2000-08-07 11:31:04  jonas
+    * fixed bug in type conversions between enum subranges (it didn't take
+      the packenum directive into account)
+    + define PACKENUMFIXED symbol in options.pas
+     (merged from fixes branch)
+
+  Revision 1.4  2000/07/14 05:11:48  michael
   + Patch to 1.1
   + Patch to 1.1
 
 
   Revision 1.3  2000/07/13 12:08:26  michael
   Revision 1.3  2000/07/13 12:08:26  michael