bugDotGNU Portable.NET - Bugs: bug #9053, ilrun throws exception when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9053: ilrun throws exception when parsing hex values

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Sat 22 May 2004 03:02:11 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Mon 19 Jul 2004 04:19:11 PM UTC, comment #2:

Fixed in CVS on 19th-July-2004

Gopal.V <t3rmin4t0r>
Project Administrator
Sat 22 May 2004 03:14:31 AM UTC, comment #1:

pr0c ran the program for me under .NET and confirmed that .NET also prints -268435456 instead of throwing an exception.

Marcus Urban <mathpup>
Sat 22 May 2004 03:02:11 AM UTC, original submission:

When parsing a numeric string in hexadecimal form (using NumberStyles.AllowHexSpecifer), Int32.Parse() on .NET treats values greater than 0x7fffffff as negative numbers. For example, 0xf0000000 turns in the decimal value -268435456, instead of throwing an exception. On the other hand, ilrun throws an exception. From reading the docs, throwing an exception seems like the correct behavior, but this is not consistent with the behavior under Rotor. I will double-checked on .NET as soon as I find someone to run it for me.

The attached program prints -268435456 on Rotor but throws an exception on ilrun:

Uncaught exception: System.OverflowException: Valid Int32 values are between -2147483648 and 2147483647, inclusive
at System.Private.NumberParser.ParseInt32(String, NumberStyles, NumberFormatInfo, Int32) in ./System/Private/NumberParser.cs:605
at System.Int32.Parse(String, NumberStyles, IFormatProvider) in ./System/Int32.cs:78
at System.Int32.Parse(String, NumberStyles) in ./System/Int32.cs:91
at Testing.Main()

Marcus Urban <mathpup>

 

Attached Files
file #1343:  parse-bug.cs added by mathpup (199B - text/x-csharp - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 19 Jul 2004 04:19:11 PM UTCt3rmin4t0rStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Sat 22 May 2004 03:02:11 AM UTCmathpupAttached File-=>Added parse-bug.cs, #1335

Back to the top


Powered by Savane 3.1-cleanup1