* ILParser.jay: When converting from int32 to int64 do an exact
authorJackson Harper <jackson@novell.com>
Thu, 22 May 2003 03:42:07 +0000 (03:42 -0000)
committerJackson Harper <jackson@novell.com>
Thu, 22 May 2003 03:42:07 +0000 (03:42 -0000)
bit conversion, not a numerical conversion.

svn path=/trunk/mcs/; revision=14791

mcs/ilasm/parser/ChangeLog
mcs/ilasm/parser/ILParser.jay

index 85b8dc85f381c38d74b4ef08b235bbc62f049218..26b105b923ccc31a8cc151ddd3410e7f479cc7c6 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-21 Jackson Harper <jackson@latitudegeo.com>
+
+       * ILParser.jay: When converting from int32 to int64 do an exact
+       bit conversion, not a numerical conversion.
+               
 2003-05-21 Jackson Harper <jackson@latitudegeo.com>
 
        * ILParser.jay: INT_I8s are not int instructions, currently the
index 2d74d57a392654260bad2a430d03b6c9f1ef3f77..500748fb01bfc6ccea100d83ea18259dda3e1eeb 100644 (file)
@@ -2014,12 +2014,9 @@ comp_qstring             : QSTRING
 int32                  : INT32\r
                         | INT64\r
                           {\r
-                                Int64 int64 = (Int64) $1;\r
-\r
-                                if (int64 > Int32.MaxValue)\r
-                                        $$ = Int32.MaxValue;\r
-                                else if (int64 < Int32.MinValue)\r
-                                        $$ = Int32.MinValue;\r
+                                long l = (long) $1;\r
+                                byte[] intb = BitConverter.GetBytes (l);\r
+                                $$ = BitConverter.ToInt32 (intb, 0);\r
                           }\r
                        ;\r
 \r