You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ml...@apache.org on 2007/07/19 05:34:13 UTC
svn commit: r557474 -
/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp
Author: mloenko
Date: Wed Jul 18 20:34:08 2007
New Revision: 557474
URL: http://svn.apache.org/viewvc?view=rev&rev=557474
Log:
fix HARMONY-2103 (Jitrino/OPT does not reject class which uses incorrect invokespecial instruction) regression
Modified:
harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp?view=diff&rev=557474&r1=557473&r2=557474
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp Wed Jul 18 20:34:08 2007
@@ -1706,6 +1706,15 @@
} else if( opcode != OP_INVOKESTATIC ) {
//pop object ref
POP_ref( expected_ref );
+
+ if( opcode == OP_INVOKESPECIAL ) {
+ //TODO: is verifier the right place for this check?
+
+ //check that 'expected_ref' is a super class of 'this'
+ if( !tpool.mustbe_assignable(tpool.sm_get_const_this(), expected_ref) ) {
+ return error(VF_ErrorUnknown, "incorrect use of invokespecial");
+ }
+ }
}
//push OUTs