[Mono-dev] News about Bug 623477?
Torello Querci
tquerci at gmail.com
Mon Aug 16 04:42:33 EDT 2010
Hi Tobias,
2010/8/16 Tobias Käs <tobias.kaes at gmx.de>:
> Torello Querci <tquerci <at> gmail.com> writes:
>>
>> [...]
>>
>> + if ((maxStackSize | 0xffff) != 0)
>> + maxStackSize = (maxStackSize | 0xffff)+0xffff;
>>
>> [...]
>>
>> + if ((maxStackSize | 0xffff) != 0)
>> + maxStackSize = (maxStackSize | 0xffff)+0xffff;
>>
>> [...]
>>
>
> This doesn't look right to me, (maxStackSize | 0xffff) is always nonzero and
> thus the branch will always be taken. From the bug entry it looks like it is
> supposed to round up to a multiple of 64K but that's not what the code is doing.
>
> Probably should be something like this: (not tested!)
>
> if ((maxStackSize & 0xffff) != 0)
> maxStackSize = (maxStackSize & ~0xffff) + 0x10000;
>
> or rounding up without branch:
>
> maxStackSize = ((maxStackSize + 0xffff) / 0x10000) * 0x10000;
>
You are right.
I prefer the first solution because is more clean.
> Just my 2c
> Regards
> Tobias Käs
>
Best Regards, Torello
More information about the Mono-devel-list
mailing list