Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test and fix for bug 81673.

svn path=/trunk/mono/; revision=81645
  • Loading branch information...
commit fe4d030d4bd24218483a4695b4d24e39613bfed0 1 parent ded3fa1
@schani schani authored
View
4 mono/metadata/ChangeLog
@@ -1,3 +1,7 @@
+2007-07-09 Mark Probst <mark.probst@gmail.com>
+
+ * class.c: Properly handle the case of an unimplemented interface
+ method. Fixes: 81673.
Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
View
12 mono/metadata/class.c
@@ -2098,6 +2098,8 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
}
if (!(vtable [io + l])) {
+ char *human_name;
+
for (j = 0; j < onum; ++j) {
g_print (" at slot %d: %s (%d) overrides %s (%d)\n", io+l, overrides [j*2+1]->name,
overrides [j*2+1]->slot, overrides [j*2]->name, overrides [j*2]->slot);
@@ -2113,7 +2115,15 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
printf ("METHOD %s(%s)\n", cm->name, msig);
g_free (msig);
}
- g_assert_not_reached ();
+
+ mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+
+ if (ifaces)
+ g_ptr_array_free (ifaces, TRUE);
+ if (override_map)
+ g_hash_table_destroy (override_map);
+
+ return;
}
}
}
View
5 mono/tests/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-09 Mark Probst <mark.probst@gmail.com>
+
+ * Makefile.am (test-bug-81673), bug-81673.cs,
+ bug-81673-interface.cs: Test for bug 81673.
+
2007-07-05 Zoltan Varga <vargaz@gmail.com>
* pinvoke3.cs libtest.c: Add new test for returning unicode strings from a delegate.
View
15 mono/tests/Makefile.am
@@ -318,13 +318,13 @@ EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_
# mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
if POWERPC
-test: testjit test-type-load test-inline-call-stack test-bug-80307
+test: testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673
else
# Can't use mkbundle on win32 since there is no static build there
if PLATFORM_WIN32
-test: testjit test-type-load test-inline-call-stack test-bug-80307
+test: testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673
else
-test: testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307
+test: testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307 test-bug-81673
endif
endif
@@ -507,6 +507,15 @@ test-bug-80307: bug-80307.exe
cd $(top_builddir)/runtime && $(MAKE) test-support-files
$(RUNTIME) bug-80307.exe
+EXTRA_DIST += bug-81673.cs bug-81673-interface.cs
+bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
+ $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
+ $(MCS) -r:bug-81673-interface.dll bug-81673.cs
+ $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
+
+test-bug-81673 : bug-81673.exe bug-81673-interface.dll
+ $(RUNTIME) --optimize=-inline bug-81673.exe
+
# Useful if mono is compiled with --enable-shared=no
patch-libtool:
cp "../../libtool" .
View
16 mono/tests/bug-81673-interface.cs
@@ -0,0 +1,16 @@
+// IMyInterface.cs created with MonoDevelop
+// User: lluis at 15:47 18/05/2007
+//
+
+using System;
+
+namespace Application
+{
+ public interface IMyInterface
+ {
+ void Run ();
+#if WITH_STOP
+ void Stop ();
+#endif
+ }
+}
View
40 mono/tests/bug-81673.cs
@@ -0,0 +1,40 @@
+// App.cs created with MonoDevelop
+// User: lluis at 15:46 18/05/2007
+//
+
+using System;
+
+namespace Application
+{
+ public class App
+ {
+ public static void Test ()
+ {
+ MyClass c = new MyClass ();
+ c.Run ();
+ }
+
+ public static int Main ()
+ {
+ int numCaught = 0;
+
+ for (int i = 0; i < 10; ++i) {
+ try {
+ Test ();
+ } catch (Exception ex) {
+ ++numCaught;
+ }
+ }
+ if (numCaught == 10)
+ return 0;
+ return 1;
+ }
+ }
+
+ class MyClass: IMyInterface
+ {
+ public void Run ()
+ {
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.