harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r557474 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp
Date Thu, 19 Jul 2007 03:34:13 GMT
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



Mime
View raw message