From 8fd9561a317aa507be72495483741ddba1f52ee2 Mon Sep 17 00:00:00 2001 From: carl Date: Fri, 6 Sep 2002 19:58:31 +0000 Subject: [PATCH] * start bugfix 1996 * 64-bit typed constant now work correctly and fully (bugfix 2001) --- compiler/defbase.pas | 35 ++++++++++++++++++++--------------- compiler/ptconst.pas | 20 +++++++++----------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/compiler/defbase.pas b/compiler/defbase.pas index e2f4c81ab5..6721950617 100644 --- a/compiler/defbase.pas +++ b/compiler/defbase.pas @@ -1863,10 +1863,10 @@ implementation b:=2; end; end; - formaldef: - {Just about everything can be converted to a formaldef...} - if not (def_from.deftype in [abstractdef,errordef]) then - b:=1; + formaldef: + {Just about everything can be converted to a formaldef...} + if not (def_from.deftype in [abstractdef,errordef]) then + b:=1; else begin { assignment overwritten ?? } @@ -1877,13 +1877,13 @@ implementation isconvertable:=b; end; - function CheckTypes(def1,def2 : tdef) : boolean; var s1,s2 : string; begin + CheckTypes:=False; if not is_equal(def1,def2) then begin { Crash prevention } @@ -1891,23 +1891,28 @@ implementation Message(type_e_mismatch) else begin - s1:=def1.typename; - s2:=def2.typename; - if (s1<>'') and (s2<>'') then - Message2(type_e_not_equal_types,def1.typename,def2.typename) + if not is_subequal(def1,def2) then + begin + s1:=def1.typename; + s2:=def2.typename; + Message2(type_e_not_equal_types,def1^.typename,def2^.typename); + end else - Message(type_e_mismatch); + CheckTypes := true; end; - CheckTypes:=false; end - else - CheckTypes:=true; - end; + else + CheckTypes := True; + end; end. { $Log$ - Revision 1.6 2002-08-20 10:31:26 daniel + Revision 1.7 2002-09-06 19:58:31 carl + * start bugfix 1996 + * 64-bit typed constant now work correctly and fully (bugfix 2001) + + Revision 1.6 2002/08/20 10:31:26 daniel * Tcallnode.det_resulttype rewritten Revision 1.5 2002/08/12 20:39:17 florian diff --git a/compiler/ptconst.pas b/compiler/ptconst.pas index 1f147d064c..4685295012 100644 --- a/compiler/ptconst.pas +++ b/compiler/ptconst.pas @@ -184,19 +184,13 @@ implementation begin if target_info.endian = endian_little then begin - curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value)); - if (tordconstnode(p).value<0) and (torddef(t.def).typ = s64bit) then - curconstSegment.concat(Tai_const.Create_32bit(-1)) - else - curconstSegment.concat(Tai_const.Create_32bit(0)); + curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value and $ffffffff)); + curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value shr 32)); end else begin - if (tordconstnode(p).value<0) and (torddef(t.def).typ = s64bit) then - curconstSegment.concat(Tai_const.Create_32bit(-1)) - else - curconstSegment.concat(Tai_const.Create_32bit(0)); - curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value)); + curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value shr 32)); + curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value and $ffffffff)); end; end else @@ -986,7 +980,11 @@ implementation end. { $Log$ - Revision 1.56 2002-09-03 16:26:27 daniel + Revision 1.57 2002-09-06 19:58:31 carl + * start bugfix 1996 + * 64-bit typed constant now work correctly and fully (bugfix 2001) + + Revision 1.56 2002/09/03 16:26:27 daniel * Make Tprocdef.defs protected Revision 1.55 2002/08/11 14:32:27 peter