[Mono-dev] Overflowed double->int casts on ARM in MS referencesource
Sebastien Pouliot
sebastien.pouliot at gmail.com
Tue Mar 24 00:20:28 UTC 2015
Hey,
On Mon, Mar 23, 2015 at 7:47 PM, Alexander Köplinger <
alex.koeplinger at outlook.com> wrote:
> I just noticed this commit by @spouliot:
> https://github.com/mono/mono/commit/298962b7ddd5e3af33c3177e8523cc36da4de553
>
> In my opinion, this isn't the right approach, we should rather fix the
> cases where a cast would overflow in MS referencesource code rather than
> changing the tests.
>
> I sent a PR a week or so ago that fixes the particular DateTime tests on
> ARM by explictly checking if the value fits into long, which I think is
> better: https://github.com/mono/referencesource/pull/8
>
Feel free to revert that commit once you PR lands. It's goal is to clear up
issues* for the next XI release.
* or non-issue in that case, DateTime works just fine
>
> There are a couple more of these overflows in MS code that make tests fail
> and I think we should discuss what the best approach is. What are your
> thoughts?
>
The real problems with unspecified values (double casted to long) is that:
a) it's unrelated to the feature being tested (i.e. it was not a DateTime
failure);
b) you can only fix the BCL for the cases we know. It's pure luck that
those tests exists, i.e. they were not written to test that condition. That
means it solves one of potentially many cases.
That being said it's still worth fixing the known cases inside the BCL
source itself - even if it requires a bit more code and is not complete :-)
Sebastien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20150323/94b16632/attachment.html>
More information about the Mono-devel-list
mailing list