* 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:
sergei 2014-06-16 17:05:01 +00:00
parent eb16231869
commit d6c6c84f76

View File

@ -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 }