harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r523276 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: class_support/classloader.cpp exception/exceptions_impl.cpp
Date Wed, 28 Mar 2007 11:02:37 GMT
Author: gshimansky
Date: Wed Mar 28 04:02:33 2007
New Revision: 523276

URL: http://svn.apache.org/viewvc?view=rev&rev=523276
Log:
Fixed bug described in HARMONY-3510 [drlvm][exceptions] DRLVM crashes on LinkageError

The problem is with LinkageError exception object creation. The message
is allocated with alloca, so memory is corrupted after function exits.
When message is corrupted, the message String object cannot be created and
OOME should be raised.


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp?view=diff&rev=523276&r1=523275&r2=523276
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Wed Mar 28 04:02:33
2007
@@ -242,7 +242,7 @@
         size_t mess_size = strlen(mess_templ) + className->len + 1;
         char* err_mess = (char*)STD_ALLOCA(mess_size);
         sprintf(err_mess, mess_templ, className->bytes);
-        exn_raise_by_name("java/lang/LinkageError", err_mess);
+        exn_raise_object(exn_create("java/lang/LinkageError", err_mess));
         TRACE(err_mess);
         return NULL;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp?view=diff&rev=523276&r1=523275&r2=523276
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp Wed Mar 28 04:02:33
2007
@@ -144,7 +144,7 @@
         string_create_from_utf8(exc_message, (unsigned) strlen(exc_message));
 
     if (!arg_obj) {
-        exn_throw_object(VM_Global_State::loader_env->java_lang_OutOfMemoryError);
+        exn_raise_object(VM_Global_State::loader_env->java_lang_OutOfMemoryError);
         return NULL;
     }
     jobject arg = oh_allocate_local_handle();
@@ -189,7 +189,7 @@
         string_create_from_utf8(exc_message, (unsigned) strlen(exc_message));
 
     if (!arg_obj) {
-        exn_throw_object(VM_Global_State::loader_env->java_lang_OutOfMemoryError);
+        exn_raise_object(VM_Global_State::loader_env->java_lang_OutOfMemoryError);
         return NULL;
     }
     jobject arg = oh_allocate_local_handle();



Mime
View raw message