[Mono-bugs] [Bug 67324][Nor] New - Incorrect casts (patch included)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 1 Oct 2004 08:47:52 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by will@exomi.com.

http://bugzilla.ximian.com/show_bug.cgi?id=67324

--- shadow/67324	2004-10-01 08:47:52.000000000 -0400
+++ shadow/67324.tmp.22513	2004-10-01 08:47:52.000000000 -0400
@@ -0,0 +1,30 @@
+Bug#: 67324
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: will@exomi.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Incorrect casts (patch included)
+
+There are some obviously incorrect casts that I noticed while browsing the
+source code.
+
+In mono/mini/ssa.c, in the function simulate_long_compare, the values are
+cast to "unsigned" for unsigned comparisons, which seems obviously
+incorrect, as it truncates the values to 32 bits on most architectures.
+
+In mono/metadata/process.c, there are several instances where pointers are
+aligned by casting to "unsigned", which is unsafe on 64-bit architectures.
+
+Suggested fix: http://will.iki.fi/patches/mono-casts.diff
+(The above is against mono-1.1.1)