[svn:parrot] r39303 - trunk/src

jonathan at svn.parrot.org jonathan at svn.parrot.org
Mon Jun 1 17:02:59 UTC 2009


Author: jonathan
Date: Mon Jun  1 17:02:58 2009
New Revision: 39303
URL: https://trac.parrot.org/parrot/changeset/39303

Log:
[core] cloned_guts is a struct, and was referencing a PMC that it appears nowhere else was. This means the PMC was unanchored from the stack (since we walk the stack looking for stuff in the PMC pool). I re-ordered the code to attach the struct to the PMC earlier, so that this shouldn't happen. (I haven't seen it happen, but it could...ran across this while trcking down an unrelated segfault).

Modified:
   trunk/src/oo.c

Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c	Mon Jun  1 16:06:20 2009	(r39302)
+++ trunk/src/oo.c	Mon Jun  1 17:02:58 2009	(r39303)
@@ -309,9 +309,9 @@
 
     /* Now create the underlying structure, and clone attributes list.class. */
     cloned_guts               = mem_allocate_zeroed_typed(Parrot_Object_attributes);
+    PMC_data(cloned)          = cloned_guts;
     cloned_guts->_class       = obj->_class;
     cloned_guts->attrib_store = VTABLE_clone(interp, obj->attrib_store);
-    PMC_data(cloned)          = cloned_guts;
     num_attrs                 = VTABLE_elements(interp, cloned_guts->attrib_store);
     for (i = 0; i < num_attrs; i++) {
         PMC * const to_clone = VTABLE_get_pmc_keyed_int(interp, cloned_guts->attrib_store, i);


More information about the parrot-commits mailing list