Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tue Sep 25 11:12:35 CEST 2001 Paolo Molaro <lupus@ximian.com>

	* interp.c: fixed get_virtual_method () to deal with interface
	methods better.

svn path=/trunk/mono/; revision=946
  • Loading branch information...
commit 433f745fed391292bedb613f7f1ddd4823778c93 1 parent 267a361
@illupus illupus authored
View
5 mono/interpreter/ChangeLog
@@ -1,4 +1,9 @@
+Tue Sep 25 11:12:35 CEST 2001 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: fixed get_virtual_method () to deal with interface
+ methods better.
+
Mon Sep 24 18:50:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
* interp.c: catch a few more error conditions with exceptions instead of
View
6 mono/interpreter/interp.c
@@ -203,8 +203,6 @@ newobj (MonoImage *image, guint32 token)
return result;
}
-#undef DEBUG_VM_DISPATCH
-
static MonoMethod*
get_virtual_method (MonoImage *image, MonoMethod *m, stackval *objs)
{
@@ -216,9 +214,9 @@ get_virtual_method (MonoImage *image, MonoMethod *m, stackval *objs)
return m;
obj = objs->data.p;
klass = objs->data.vt.klass ? objs->data.vt.klass: obj->klass;
- if (!(m->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
+ if (!(m->klass->flags & TYPE_ATTRIBUTE_INTERFACE) || klass->flags & TYPE_ATTRIBUTE_INTERFACE)
klass = obj->klass;
- for (; klass && klass != m->klass; klass = klass->parent) {
+ for (; klass ; klass = klass->parent) {
for (i = 0; i < klass->method.count; ++i) {
if (!klass->methods [i]->flags & METHOD_ATTRIBUTE_VIRTUAL)
continue;
View
1  mono/tests/Makefile.am
@@ -24,6 +24,7 @@ TESTSRC= \
enum.cs \
property.cs \
interface.cs \
+ iface.cs \
virtual-method.cs \
intptrcast.cs \
indexer.cs \
View
23 mono/tests/iface.cs
@@ -0,0 +1,23 @@
+public interface IHelloWorldWriter
+{
+ int WriteIt();
+}
+
+public class RealWriter : IHelloWorldWriter
+{
+ public int WriteIt()
+ {
+ return 33;
+ }
+}
+
+public class ProjectName {
+ static int Main()
+ {
+ IHelloWorldWriter writer = new RealWriter();
+ if (writer.WriteIt() != 33)
+ return 1;
+ return 0;
+ }
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.