harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arc...@apache.org
Subject svn commit: r369026 - /incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve2.c
Date Sat, 14 Jan 2006 14:30:52 GMT
Author: archie
Date: Sat Jan 14 06:30:49 2006
New Revision: 369026

URL: http://svn.apache.org/viewcvs?rev=369026&view=rev
Log:
Fix assertion failure in the case of INVOKEINTERFACE on a method that is
declared by java.lang.Object. In this case, we can INVOKEVIRTUAL instead.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve2.c

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve2.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve2.c?rev=369026&r1=369025&r2=369026&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve2.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/resolve2.c Sat Jan
14 06:30:49 2006
@@ -801,9 +801,23 @@
 				goto post_fail;
 			}
 
-			/* Handle "Miranda methods" (punt) */
+			/*
+			 * Handle mismatch of the opcode and the interfaceness
+			 * of the method being invoked.
+			 *
+			 * The first case is "Miranda methods", a normal
+			 * invocation of an interface method. This happens when
+			 * an abstract class implements an interface but not
+			 * all of the interface's methods.
+			 *
+			 * The second case is INVOKEINTERFACE on a method of
+			 * java.lang.Object. This only happens when an interface
+			 * declares one of these methods (e.g., hashCode()).
+			 */
 			if (_JC_ACC_TEST(imethod->class, INTERFACE))
 				opcode = _JC_invokeinterface;
+			else if (opcode == _JC_invokeinterface)
+			    	opcode = _JC_invokevirtual;
 
 			/* Check static-ness and virtual-ness */
 			if (((opcode == _JC_invokestatic)



Mime
View raw message