Browse Source

* fix for boolean to comp conversion (now disabled)

pierre 26 years ago
parent
commit
f01a9ec364
1 changed files with 12 additions and 6 deletions
  1. 12 6
      compiler/htypechk.pas

+ 12 - 6
compiler/htypechk.pas

@@ -236,11 +236,14 @@ implementation
              begin
              begin
                case def_from^.deftype of
                case def_from^.deftype of
                 orddef : begin { ordinal to real }
                 orddef : begin { ordinal to real }
-                           if pfloatdef(def_to)^.typ=f32bit then
-                            doconv:=tc_int_2_fix
-                           else
-                            doconv:=tc_int_2_real;
-                           b:=true;
+                           if is_integer(def_from) then
+                             begin
+                                if pfloatdef(def_to)^.typ=f32bit then
+                                  doconv:=tc_int_2_fix
+                                else
+                                  doconv:=tc_int_2_real;
+                                b:=true;
+                             end;
                          end;
                          end;
               floatdef : begin { 2 float types ? }
               floatdef : begin { 2 float types ? }
                            if pfloatdef(def_from)^.typ=pfloatdef(def_to)^.typ then
                            if pfloatdef(def_from)^.typ=pfloatdef(def_to)^.typ then
@@ -713,7 +716,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1998-12-15 17:11:37  peter
+  Revision 1.14  1999-01-19 15:55:32  pierre
+   * fix for boolean to comp conversion (now disabled)
+
+  Revision 1.13  1998/12/15 17:11:37  peter
     * string:=pchar not allowed in tp mode
     * string:=pchar not allowed in tp mode
 
 
   Revision 1.12  1998/12/11 00:03:18  peter
   Revision 1.12  1998/12/11 00:03:18  peter