harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r473149 - /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.h
Date Fri, 10 Nov 2006 00:27:52 GMT
Author: gshimansky
Date: Thu Nov  9 16:27:52 2006
New Revision: 473149

URL: http://svn.apache.org/viewvc?view=rev&rev=473149
Log:
Applied HARMONY-2134 [drlvm][jvmti] element_moved() may segfault when moving tag of an reclaimed
object

Tests passed on ubuntu and windows xp


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.h

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.h?view=diff&rev=473149&r1=473148&r2=473149
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.h (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.h Thu Nov  9 16:27:52
2006
@@ -96,8 +96,14 @@
 // update tag pointer in objects when the tag pair has been moved
 // ("magically" called by ulist<tag_pair>::erase())
 inline void element_moved(tag_pair* from, tag_pair* to) {
-    tag_pair** tptr = ti_get_object_tptr(from->obj);
-    *tptr = to;
+    assert(from->obj == to->obj);
+    assert(from->tag == to->tag);
+    // if object was already reclaimed and weak root reset,
+    // the object->tag_pair pointer does not need to be updated
+    if (from->obj != NULL) {
+        tag_pair** tptr = ti_get_object_tptr(from->obj);
+        *tptr = to;
+    }
 }
 
 



Mime
View raw message