* mcs/statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
* gmcs/statement.cs: Likewise.
* tests/test-499.cs: New test from #77958.
(test-499.cs appears to trigger a JIT bug)
svn path=/trunk/mcs/; revision=58889
2006-04-01 Raja R Harinath <rharinath@novell.com>
+ Fix #77958
+ * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
+
Fix #77962
* report.cs (SymbolRelatedToPreviousError): Drop generic type
arguments before checking whether a type is reflected or not.
-2006-04-01 Raja R Harinath <rharinath@novell.com>
-
- Fix #77954.
+ Fix #77954
* expression.cs (Invocation.IsApplicable): Ensure a generic method
definition doesn't take part in overload resolution.
(Invocation.IsParamsMethodApplicable): Likewise.
}
else if (k is ulong)
{
- if ((ulong) k < (1L<<32))
+ ulong ul = (ulong) k;
+ if (ul < (1L<<32))
{
- IntConstant.EmitInt (ig, (int) (long) k);
+ IntConstant.EmitInt (ig, unchecked ((int) ul));
ig.Emit (OpCodes.Conv_U8);
}
else
{
- LongConstant.EmitLong (ig, unchecked ((long) (ulong) k));
+ LongConstant.EmitLong (ig, unchecked ((long) ul));
}
}
else if (k is char)
+2006-04-01 Raja R Harinath <rharinath@novell.com>
+
+ Fix #77958
+ * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
+
2006-04-01 Marek Safar <marek.safar@seznam.cz>
A fix for #77966.
}
else if (k is ulong)
{
- if ((ulong) k < (1L<<32))
+ ulong ul = (ulong) k;
+ if (ul < (1L<<32))
{
- IntConstant.EmitInt (ig, (int) (long) k);
+ IntConstant.EmitInt (ig, unchecked ((int) ul));
ig.Emit (OpCodes.Conv_U8);
}
else
{
- LongConstant.EmitLong (ig, unchecked ((long) (ulong) k));
+ LongConstant.EmitLong (ig, unchecked ((long) ul));
}
}
else if (k is char)
+2006-04-01 Raja R Harinath <rharinath@novell.com>
+
+ * test-499.cs: New test from #77958.
+
2006-04-01 Raja R Harinath <rharinath@novell.com>
* gtest-265.cs, gtest-265-lib.cs: New test from #77954.
test-476.cs
gtest-230.cs
+test-499.cs
test-anon-27.cs
test-xml-027.cs
+
+test-499.cs
--- /dev/null
+class X {
+ static void Main ()
+ {
+ ulong x = 1;
+ switch (x) {
+ case 0:
+ break;
+ }
+ }
+}