Bug 3677 - sbyte throws error
Summary: sbyte throws error
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-02-28 20:04 UTC by hani
Modified: 2012-03-10 12:24 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description hani 2012-02-28 20:04:52 UTC
following code throws an error

sbyte newByte = sbyte.Parse("E3", System.Globalization.NumberStyles.HexNumber);

Overflow Exception: Value too large or too small

instead of returning a negative value

value returned should be

Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-02-29 04:28:40 UTC
Same problem exists with short:

short.Parse("E3E3", System.Globalization.NumberStyles.HexNumber);
Comment 2 Sebastien Pouliot 2012-03-10 11:59:36 UTC
works on mono master (unit tests added in 18293075d387063a07bd81502c2c03d05be3d709)
fails on mono-2-10 branch (unit tests added in daafc06b54544eac75d311045f06d3cbe7fd1f19)
so something was not backported
Comment 3 Sebastien Pouliot 2012-03-10 12:24:27 UTC
this was fixed by 1b25865bfbd0ede898a79ddb882c60d65c15b72c
backported to mono-2-10 in 3adb9e170d6a733cb30dd3dc4041db48374bbd6a
backported to mobile-master in 7b7b509d6c02eebc15ec40a5f7ccc3ba0a2e8e61
backported to 5.2-series in a152ba20a090070bf3a8ca28df606b196630b47b
QA: unit tests in mono (both 2.10 and master)

Thanks for the bug report. The fix will be available the next builds of MonoTouch 5.2+