* ILParser.jay: Set int64's masquerading as int32 to upper and
authorJackson Harper <jackson@novell.com>
Sun, 4 May 2003 19:53:30 +0000 (19:53 -0000)
committerJackson Harper <jackson@novell.com>
Sun, 4 May 2003 19:53:30 +0000 (19:53 -0000)
lower bounds if neccasary. NEED TO TEST this behavoir on windows.

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

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

index 808b4e04138254685c89ac8feff8362617a69dcc..c22ea070ca4d678d7c7a5ee45c2a58cec9da0ea8 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-04 Jackson Harper <jackson@latitudegeo.com>
+
+       * ILParser.jay: Set int64's masquerading as int32 to upper and
+       lower bounds if neccasary. NEED TO TEST this behavoir on windows.
+               
 2003-05-01 Jackson Harper <jackson@latitudegeo.com>
 
        * ILParser.jay: Fix a bunch of conversions, implement hexbytes
index 84606698289f9eadd6e02e09e6369c127c87aec3..63e5422242e4234da7948e220af82aaa55d74905 100644 (file)
@@ -1504,9 +1504,8 @@ instr                     : INSTR_NONE
                        | INSTR_VAR int32\r
                        | INSTR_I int32\r
                           {\r
-                           //     Console.WriteLine ((Int64) $2);\r
-                           //     codegen.CurrentMethodDef.AddInstr (new\r
-                           //             IntInstr ((IntOp) $1, (int) $2));\r
+                                codegen.CurrentMethodDef.AddInstr (new\r
+                                        IntInstr ((IntOp) $1, (int) $2));\r
                           }\r
                        | INSTR_I id /* Allow variable names */\r
                        | INSTR_I8 int64\r
@@ -1786,11 +1785,19 @@ comp_qstring            : QSTRING
                        ;\r
 \r
 int32                  : INT32\r
-                       | INT64\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
+                          }\r
                        ;\r
 \r
-int64                  : INT32\r
-                       | INT64\r
+int64                  : INT64\r
+                        | INT32\r
                        ;\r
 \r
 float64                        : FLOAT64\r