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

Submitter:  Marcus Urban <mathpup>
Submitted:  Sat 22 May 2004 03:02:11 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-07-19 t3rmin4t0r StatusNone Fixed
    Open/ClosedOpen Closed
2004-05-22 mathpup Attached File- Added parse-bug.cs, #1335

Back to the top

Powered by Savane 3.15-e6e5.
Corresponding source code