[FAST486]

The number of bit places in a shift operation is ANDed by the width of the type
when it is in a register, so (1 << c), when c is 32, is actually 1, and not 0.
Fix the calculation of MaxValue by using SignFlag | (SignFlag - 1) instead.


svn path=/branches/ntvdm/; revision=60912
This commit is contained in:
Aleksandar Andrejevic 2013-11-10 03:11:56 +00:00
parent e62c987917
commit fda5745543

View file

@ -43,7 +43,7 @@ Fast486ArithmeticOperation(PFAST486_STATE State,
{
ULONG Result;
ULONG SignFlag = 1 << (Bits - 1);
ULONG MaxValue = (1 << Bits) - 1;
ULONG MaxValue = (SignFlag - 1) | SignFlag;
/* Make sure the values don't exceed the maximum for their size */
FirstValue &= MaxValue;