harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r501839 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: init/parse_arguments.cpp verifier/Verifier.cpp verifier/ver_dataflow.cpp verifier/ver_utils.cpp
Date Wed, 31 Jan 2007 13:41:11 GMT
Author: gshimansky
Date: Wed Jan 31 05:41:10 2007
New Revision: 501839

URL: http://svn.apache.org/viewvc?view=rev&rev=501839
Log:
Applied HARMONY-2905 [drlvm][jvmti] java.lang.VerifyError is thrown for instrumented class

Tests passed on Ubuntu6 x86, Windows 2003 server x86 and SuSE9 x86_64


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp?view=diff&rev=501839&r1=501838&r2=501839
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp Wed Jan 31 05:41:10
2007
@@ -455,6 +455,10 @@
             p_env->verify_all = true;
             p_env->verify_strict = true;
         }
+        else if (strcmp(option, "-Xverify:strict") == 0) {
+            p_env->verify_all = true;
+            p_env->verify_strict = true;
+        }
         else if (strcmp(option, "-verify") == 0) {
             p_env->verify_all = true;
         }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp?view=diff&rev=501839&r1=501838&r2=501839
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp Wed Jan 31 05:41:10 2007
@@ -5496,7 +5496,7 @@
     *message = context.m_error;
 #if _VERIFY_DEBUG
     if( result != VER_OK ) {
-        VERIFY_DEBUG( "VerifyError: " << (context.m_error ? context.m_error : "NULL")
);
+        TRACE2("verifier", "VerifyError: " << (context.m_error ? context.m_error :
"NULL") );
     }
 #endif // _VERIFY_DEBUG
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp?view=diff&rev=501839&r1=501838&r2=501839
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp Wed Jan 31 05:41:10
2007
@@ -460,14 +460,20 @@
     // check initialization
     if( source->m_type == SM_UNINITIALIZED && target->m_type != SM_UNINITIALIZED)
{
         if( (source->m_new == 0 && target->m_ctype == VF_CHECK_ACCESS_FIELD)
-            || (local_init == false && target->m_ctype == VF_CHECK_UNINITIALIZED_THIS)
)
+            || (local_init == false && target->m_ctype == VF_CHECK_UNINITIALIZED_THIS)
+            || (!ctex->m_dump.m_verify && source->m_new == 0
+                    && target->m_ctype == VF_CHECK_UNINITIALIZED_THIS) )
         {
             // 1. In initialization method instance fields of this
             //    that are declared in the current class may be assigned
-            //    before calling any instance initialization method
+            //    before calling any instance initialization method.
             // 2. Uninitialized class instance can be stored in
             //    a local variable if no backward branch is taken or
             //    the code isn't protected by exception handler.
+            // 3. In default mode (without any verifier control options)
+            //    uninitiliazed class reference in initialization method
+            //    can be stored in a local variable if backward branch is
+            //    taken or the code is protected by exception handler.
         } else {
             VERIFY_REPORT( ctex, "(class: " << class_get_name( ctex->m_class ) 
                 << ", method: " << method_get_name( ctex->m_method )
@@ -715,16 +721,16 @@
  * Function clears stack map vector.
  */
 static inline void
-vf_clear_stack( vf_MapVector_t *vector )    // stack map vector
+vf_clear_stack( vf_MapVector_t *vector )    // map vector
 {
-    unsigned short index;
     vf_MapEntry_t zero_entry = {0};
 
     // zero stack vector
-    for( index = 0; index < vector->m_deep; index++ ) {
+    for( unsigned index = 0; index < vector->m_deep; index++ ) {
         vector->m_stack[index] = zero_entry;
     }
     vector->m_deep = 0;
+
     return;
 } // vf_clear_stack
 
@@ -915,12 +921,7 @@
                                   instr->m_inlen, ctex );
         return VER_OK;
     } else if( vf_is_instruction_has_flags( instr, VF_FLAG_THROW ) ) {
-        // clear stack
-        unsigned deep = invector->m_deep;
-        vf_clear_stack( invector );
         // set result vector stack deep
-        invector->m_deep = (unsigned short)(deep + instr->m_stack);
-        // set out vector
         invector->m_stack->m_type = SM_TERMINATE;
         return VER_OK;
     }
@@ -1131,7 +1132,11 @@
     if( !memcmp( method_get_name( ctex->m_method ), "<init>", 7 )
         && ctex->m_vtype.m_class != ctex->m_vtype.m_object )
     {
-        if( invector->m_local->m_type == SM_UNINITIALIZED ) {
+        if( invector->m_local->m_type != SM_UNINITIALIZED
+            && invector->m_local->m_vtype == ctex->m_vtype.m_class)
+        {
+            // constructor returns initialized reference of a given class
+        } else {
             VERIFY_REPORT( ctex, "(class: " << class_get_name( ctex->m_class ) 
                 << ", method: " << method_get_name( ctex->m_method )
                 << method_get_descriptor( ctex->m_method )

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp?view=diff&rev=501839&r1=501838&r2=501839
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp Wed Jan 31 05:41:10
2007
@@ -1292,7 +1292,7 @@
             return VER_OK;
         }
         if( method_is_protected( method ) ) {
-            if( instance_name[0] == '[' && !memcmp( method_get_name( method ), "clone",
7 ) ) {
+            if( instance_name[0] == '[' && !memcmp( method_get_name( method ), "clone",
6 ) ) {
                 // for arrays function clone is public
             } else {
                 need_check = true;



Mime
View raw message