mail-archives/mono-bugs/2009-February/085374.html

118 строки
5.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 471275] Internal compiler error -&gt; System.OverflowException: Value is greater than Int64.MaxValue
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20471275%5D%20Internal%20compiler%20error%20-%3E%0A%20System.OverflowException%3A%20Value%20is%20greater%20than%20Int64.MaxValue&In-Reply-To=bug-471275-28286%40https.bugzilla.novell.com/">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="085373.html">
<LINK REL="Next" HREF="085375.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 471275] Internal compiler error -&gt; System.OverflowException: Value is greater than Int64.MaxValue</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20471275%5D%20Internal%20compiler%20error%20-%3E%0A%20System.OverflowException%3A%20Value%20is%20greater%20than%20Int64.MaxValue&In-Reply-To=bug-471275-28286%40https.bugzilla.novell.com/"
TITLE="[Mono-bugs] [Bug 471275] Internal compiler error -&gt; System.OverflowException: Value is greater than Int64.MaxValue">bugzilla_noreply at novell.com
</A><BR>
<I>Sun Feb 1 16:07:23 EST 2009</I>
<P><UL>
<LI>Previous message: <A HREF="085373.html">[Mono-bugs] [Bug 471068] DataGridView. Crash when adding Row and listening for Rows.CollectionChanged
</A></li>
<LI>Next message: <A HREF="085375.html">[Mono-bugs] [Bug 470568] mono_thread_current() called after TlsFree(current_object_key)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#85374">[ date ]</a>
<a href="thread.html#85374">[ thread ]</a>
<a href="subject.html#85374">[ subject ]</a>
<a href="author.html#85374">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="https://bugzilla.novell.com/show_bug.cgi?id=471275">https://bugzilla.novell.com/show_bug.cgi?id=471275</A>
User <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">andyhume32 at yahoo.co.uk</A> added comment
<A HREF="https://bugzilla.novell.com/show_bug.cgi?id=471275#c2">https://bugzilla.novell.com/show_bug.cgi?id=471275#c2</A>
Andy Hume &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">andyhume32 at yahoo.co.uk</A>&gt; changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">andyhume32 at yahoo.co.uk</A>
--- Comment #2 from Andy Hume &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">andyhume32 at yahoo.co.uk</A>&gt; 2009-02-01 14:07:22 MST ---
Orthogal to the reported problem, and I'm sure you'd have discovered it once
the compile was working, but you need some more casts in Lookup(ushort, ushort,
ushort, ushort). All the shifts are done on Int32 (the narrowest defined shift
operator), so you don't get the answers you wanted! See the sample below, and
see e.g. <A HREF="http://www.jaggersoft.com/csharp_standard/14.8.htm">http://www.jaggersoft.com/csharp_standard/14.8.htm</A> for the reasons --
including why deviceID is shifted by 0 bits!!
using System;
class LeftShifting {
static void Main()
{
Lookup(1, 2, 3, 4);
LookupB(1, 2, 3, 4);
}
public static string Lookup(ushort vendorID, ushort deviceID, ushort
subSystem, ushort subVendor)
{
ulong x = ((ulong)((vendorID &lt;&lt; 48) | (deviceID &lt;&lt; 32) | (subSystem &lt;&lt;
16) | subVendor));
string s = string.Format(&quot;Lookup4 x: 0x{0:X16}&quot;, x);
Console.WriteLine(s);
return s;
}
public static string LookupB(ushort vendorID, ushort deviceID, ushort
subSystem, ushort subVendor)
{
ulong x = ((((ulong)vendorID &lt;&lt; 48) | ((ulong)deviceID &lt;&lt; 32) |
((ulong)subSystem &lt;&lt; 16) | subVendor));
string s = string.Format(&quot;Lookup4b x: 0x{0:X16}&quot;, x);
Console.WriteLine(s);
return s;
}
}
--
Configure bugmail: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="085373.html">[Mono-bugs] [Bug 471068] DataGridView. Crash when adding Row and listening for Rows.CollectionChanged
</A></li>
<LI>Next message: <A HREF="085375.html">[Mono-bugs] [Bug 470568] mono_thread_current() called after TlsFree(current_object_key)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#85374">[ date ]</a>
<a href="thread.html#85374">[ thread ]</a>
<a href="subject.html#85374">[ subject ]</a>
<a href="author.html#85374">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>