mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 21:50:14 +02:00
* calc_divconst_magic_unsigned: explicitly limit the shift amount to number of bits of target platform. This happens implicitly only on x86, on other 32-bit targets shifting by more than 31 bits calculates as zero.
git-svn-id: trunk@27983 -
This commit is contained in:
parent
eb16231869
commit
d6c6c84f76
@ -388,7 +388,7 @@ uses
|
||||
magic_add:=false;
|
||||
{$push}
|
||||
{$warnings off }
|
||||
mask:=aWord(not 0) shr (64-N);
|
||||
mask:=aWord(not 0) shr ((64-N) and (sizeof(aWord)*8-1));
|
||||
nc:=(mask-(-d) mod aInt(d));
|
||||
{$pop}
|
||||
p:=N-1; { initialize p }
|
||||
|
Loading…
Reference in New Issue
Block a user