mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:29:27 +02:00
* PopCount takes care only of the bit pattern, so take the uvalue to avoid an internal error, resolves #40190
This commit is contained in:
parent
98fa292b20
commit
64319dc019
@ -1833,7 +1833,8 @@ implementation
|
||||
t:=nil;
|
||||
cr:=0;
|
||||
end;
|
||||
if (t<>nil) and (PopCnt(cr) = 1) then
|
||||
{ using cr.uvalue is fine as we are interested only in the bit pattern }
|
||||
if (t<>nil) and (PopCnt(cr.uvalue) = 1) then
|
||||
begin
|
||||
if is_constintnode(taddnode(t).left) then
|
||||
vl:=taddnode(t).left
|
||||
|
11
tests/webtbs/tw40190.pp
Normal file
11
tests/webtbs/tw40190.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{ %opt=-O2 }
|
||||
{ %norun }
|
||||
function InternalInt64ToInt8(Value: Int64; Dest: IntPtr; IgnoreConvertErrors: Boolean): Boolean;
|
||||
begin
|
||||
if (Value and $FFFFFFFFFFFFFF80 <> 0) and (Value and $FFFFFFFFFFFFFF80 <> $FFFFFFFFFFFFFF80) then begin
|
||||
// remainder not relevant
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user