[Mono-bugs] [Bug 79031][Wis] New - Comparison between two function pointer types not implemented

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 8 08:40:28 EDT 2006


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 roberto.costa at st.com.

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

--- shadow/79031	2006-08-08 08:40:28.000000000 -0400
+++ shadow/79031.tmp.30999	2006-08-08 08:40:28.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 79031
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: massi at ximian.com                            
+ReportedBy: roberto.costa at st.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Comparison between two function pointer types not implemented
+
+The comparison of two types of kind function pointer (MONO_TYPE_FNPTR,
+which is 0x1b) is not implemented in Mono 1.1.16.1.
+In particular, in function do_mono_metadata_type_equal(...) there is no
+case for MONO_TYPE_FNPTR types.
+
+Here is a simple C example in which such a comparison is required:
+
+------ qsort.c -----------------
+#include <stdlib.h>
+
+int cmp(const void *pa, const void *pb)
+{
+    int a = *(const int*)pa;
+    int b = *(const int*)pb;
+
+    return (a - b);
+}
+
+int main()
+{
+    int a[6] = {9, -3, 4, 0, 1, -2};
+    int b[6];
+    int i;
+
+    qsort(a, 6, sizeof(int), cmp);
+
+    for (i=0; i < 5; ++i)
+        if (a[i] > a[i+1])
+            return 1;
+
+    return 0;
+}
+--------------------------------
+
+qsort.exe has to be compiled with gcc4cil:
+cil32-gcc -O2 qsort.c -o qsort.exe
+
+Here is what happens if Mono executes qsort.exe:
+> mono qsort.exe
+** ERROR **: implement type compare for 1b!
+aborting...
+
+Attached are all the binaries needed to reproduce the problem.


More information about the mono-bugs mailing list