* do not convert a boolean to a 32 bit int first when converting to a 64 bit int, this causes data loss when casting e.g. a qwordbool to a qword

git-svn-id: trunk@26301 -
This commit is contained in:
florian 2013-12-28 20:19:51 +00:00
parent b47f1c4176
commit 2081b9cad7

View File

@ -3045,21 +3045,11 @@ implementation
begin
first_bool_to_int:=nil;
{ byte(boolean) or word(wordbool) or longint(longbool) must
be accepted for var parameters }
be accepted for var parameters }
if (nf_explicit in flags) and
(left.resultdef.size=resultdef.size) and
(left.expectloc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_CREGISTER]) then
exit;
{ when converting to 64bit, first convert to a 32bit int and then }
{ convert to a 64bit int (only necessary for 32bit processors) (JM) }
if resultdef.size > sizeof(aint) then
begin
result := ctypeconvnode.create_internal(left,sinttype);
result := ctypeconvnode.create(result,resultdef);
left := nil;
firstpass(result);
exit;
end;
expectloc:=LOC_REGISTER;
end;