mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 23:10:31 +02:00
* 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:
parent
b47f1c4176
commit
2081b9cad7
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user