[Mono-dev] News about Bug 623477?

Tobias Käs tobias.kaes at gmx.de
Mon Aug 16 03:41:06 EDT 2010


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;

Just my 2c
Regards
Tobias Käs



More information about the Mono-devel-list mailing list