* ILParser.jay: Fix casting for data type constants.
authorJackson Harper <jackson@novell.com>
Wed, 26 May 2004 01:37:52 +0000 (01:37 -0000)
committerJackson Harper <jackson@novell.com>
Wed, 26 May 2004 01:37:52 +0000 (01:37 -0000)
svn path=/trunk/mcs/; revision=28116

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

index 468e5f206028fd328e1e86e84d0501268d093ba7..6ab10ee7057d55edbe3f4a2205f20f4c0c187171 100644 (file)
@@ -1,3 +1,7 @@
+2004-05-25  Jackson Harper  <jackson@ximian.com>
+
+       * ILParser.jay: Fix casting for data type constants.
+       
 2004-05-22  Jackson Harper  <jackson@ximian.com>
 
        * ILParser.jay: [,] is short form for [...,...] this fixes bug
index dbeaef0e958ffd554ed8f624d1e6427fa667d4a5..7ba228f13d3a4e1c9b8f0ac7adc84343b48ea3f2 100644 (file)
@@ -1136,11 +1136,11 @@ field_decl              : D_FIELD repeat_opt field_attr type id at_opt init_opt
                                 if ($2 != null) {\r
                                         field_def.SetOffset ((uint) $2);\r
                                 }\r
-                                \r
+\r
                                 if ($6 != null) {\r
                                         field_def.AddDataValue ((string) $6);\r
                                 }\r
-                                \r
+\r
                                 if ($7 != null) {\r
                                         field_def.SetValue ((Constant) $7);\r
                                 }\r
@@ -1363,7 +1363,8 @@ dataitem          : K_CHAR STAR OPEN_PARENS comp_qstring CLOSE_PARENS
                           }\r
                        | K_FLOAT32 OPEN_PARENS float64 CLOSE_PARENS repeat_opt\r
                           {\r
-                                FloatConst float_const = new FloatConst ((float) $3);\r
+                                double d = (double) $3;\r
+                                FloatConst float_const = new FloatConst ((float) d);\r
 \r
                                 if ($5 != null)\r
                                         $$ = new RepeatedConstant (float_const, (int) $5);\r
@@ -1399,7 +1400,8 @@ dataitem          : K_CHAR STAR OPEN_PARENS comp_qstring CLOSE_PARENS
                           }\r
                        | K_INT16 OPEN_PARENS int32 CLOSE_PARENS repeat_opt\r
                           {\r
-                                IntConst int_const = new IntConst ((short) $3);\r
+                                int i = (int) $3;\r
+                                IntConst int_const = new IntConst ((short) i);\r
 \r
                                 if ($5 != null)\r
                                         $$ = new RepeatedConstant (int_const, (int) $5);\r
@@ -1408,7 +1410,8 @@ dataitem          : K_CHAR STAR OPEN_PARENS comp_qstring CLOSE_PARENS
                           }\r
                        | K_INT8 OPEN_PARENS int32 CLOSE_PARENS repeat_opt\r
                           {\r
-                                IntConst int_const = new IntConst ((sbyte) $3);\r
+                                int i = (int) $3;\r
+                                IntConst int_const = new IntConst ((sbyte) i);\r
 \r
                                 if ($5 != null)\r
                                         $$ = new RepeatedConstant (int_const, (int) $5);\r