Revision: 3965 http://trac.macosforge.org/projects/ruby/changeset/3965 Author: lsansonetti@apple.com Date: 2010-04-26 22:54:26 -0700 (Mon, 26 Apr 2010) Log Message: ----------- more missing write barriers Modified Paths: -------------- MacRuby/trunk/st.c MacRuby/trunk/vm.cpp Modified: MacRuby/trunk/st.c =================================================================== --- MacRuby/trunk/st.c 2010-04-27 03:07:18 UTC (rev 3964) +++ MacRuby/trunk/st.c 2010-04-27 05:54:26 UTC (rev 3965) @@ -356,7 +356,7 @@ head->back = entry;\ }\ else {\ - table->head = entry;\ + GC_WB(&table->head, entry);\ entry->fore = entry;\ entry->back = entry;\ }\ @@ -458,7 +458,7 @@ if ((ptr = table->head) != 0) { do { hash_val = ptr->hash % new_num_bins; - ptr->next = new_bins[hash_val]; + GC_WB(&ptr->next, new_bins[hash_val]); GC_WB(&new_bins[hash_val], ptr); } while ((ptr = ptr->fore) != table->head); } @@ -493,6 +493,8 @@ entry = alloc(st_table_entry); assert(entry != NULL); *entry = *ptr; + GC_WB(&entry->key, ptr->key); + GC_WB(&entry->record, ptr->record); hash_val = entry->hash % num_bins; GC_WB(&entry->next, new_table->bins[hash_val]); GC_WB(&new_table->bins[hash_val], entry); @@ -500,7 +502,8 @@ prev = entry; *tail = entry; tail = &entry->fore; - } while ((ptr = ptr->fore) != old_table->head); + } while ((ptr = ptr->fore) != old_table->head && ptr != NULL); + GC_WB(&new_table->head, new_table->head); entry = new_table->head; entry->back = prev; *tail = entry; Modified: MacRuby/trunk/vm.cpp =================================================================== --- MacRuby/trunk/vm.cpp 2010-04-27 03:07:18 UTC (rev 3964) +++ MacRuby/trunk/vm.cpp 2010-04-27 05:54:26 UTC (rev 3965) @@ -3395,8 +3395,8 @@ b->arity.real = 1; b->flags = VM_BLOCK_PROC; b->imp = (IMP)rb_vm_block_curry; - b->dvars[0] = (VALUE *)proc; - b->dvars[1] = (VALUE *)passed; + GC_WB(&b->dvars[0], (VALUE *)proc); + GC_WB(&b->dvars[1], (VALUE *)passed); b->dvars[2] = (VALUE *)arity; return rb_proc_alloc_with_block(rb_cProc, b);