2004-12-02 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Mon, 6 Dec 2004 00:57:22 +0000 (00:57 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 6 Dec 2004 00:57:22 +0000 (00:57 -0000)
* ILParser.jay(field_init): Explicit cast to the target type, this
is what ilasm does (0xFFFFFFFF) as an int gets translated

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

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

index 1dfae0e01ca936455f3c5ec80e2c9bf1f86b7a9f..a31c756ea4bc1ed5e21267f993cc7be393ffe753 100644 (file)
@@ -28,17 +28,11 @@ namespace Mono.ILASM {
                        System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
 
                         DriverMain driver = new DriverMain (args);
-                        try {
                                 if (!driver.Run ()) {
                                         Console.WriteLine ();
                                         Console.WriteLine ("***** FAILURE *****");
                                         return 1;
                                 }
-                        } catch (Exception e) {
-                                Console.WriteLine (e);
-                                Console.WriteLine ("Error while compiling.");
-                                return 1;
-                        }
                         Console.WriteLine ("Operation completed successfully");
                         return 0;
                 }
@@ -68,7 +62,6 @@ namespace Mono.ILASM {
 
                         public bool Run ()
                         {
-                                try {
                                         if (il_file_list.Count == 0)
                                                 Usage ();
                                         if (output_file == null)
@@ -82,10 +75,6 @@ namespace Mono.ILASM {
                                         if (report.ErrorCount > 0)
                                                 return false;
                                         codegen.Write ();
-                                } catch {
-                                        return false;
-                                }
-
                                 return true;
                         }
 
index 82cc054c21cd9aeb54cfcc7465d163a6010d3154..f5989e4eb76e54a7e67ebaef83fbf3015c71b7a1 100644 (file)
@@ -1,6 +1,9 @@
 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
 
-       * ILParser.jay: Added D_STACKRESERVE token.
+       * ILParser.jay(field_init): Explicit cast to the target type, this
+       is what ilasm does (0xFFFFFFFF) as an int gets translated
+       
+       Added D_STACKRESERVE token.
 
        (prop_head, event_head): Allow it to take a compound name (for explicit
        interface implementations of properties).
index 6e6dfbcc475501e5ca63f7dcbb4fb5880a2245db..45b24ec08ef026605e6f94fdc3cfd4a728bc4b36 100644 (file)
@@ -51,6 +51,7 @@ namespace Mono.ILASM {
 \r
                         return b;\r
                 }\r
+\r
 %}\r
 \r
 %token EOF\r
@@ -1264,11 +1265,11 @@ field_init              : K_FLOAT32 OPEN_PARENS float64 CLOSE_PARENS
                           }\r
                        | K_INT32 OPEN_PARENS int64 CLOSE_PARENS\r
                           {\r
-                                $$ = new IntConst (Convert.ToInt32 ($3));\r
+                                $$ = new IntConst ((int)((long)$3));\r
                           }\r
                        | K_INT16 OPEN_PARENS int64 CLOSE_PARENS\r
                           {\r
-                                $$ = new IntConst (Convert.ToInt16 ($3));\r
+                                $$ = new IntConst ((short)((long) $3));\r
                           }\r
                        | K_CHAR OPEN_PARENS int64 CLOSE_PARENS\r
                           {\r
@@ -1280,7 +1281,7 @@ field_init                : K_FLOAT32 OPEN_PARENS float64 CLOSE_PARENS
                          }\r
                        | K_INT8 OPEN_PARENS int64 CLOSE_PARENS\r
                           {\r
-                                $$ = new IntConst (Convert.ToByte ($3));\r
+                                $$ = new IntConst ((byte)((long) ($3)));\r
                           }\r
                        | K_BOOL OPEN_PARENS truefalse CLOSE_PARENS\r
                           {\r