[macruby-changes] [2462] MacRuby/trunk/vm.h

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 3 15:17:43 PDT 2009


Revision: 2462
          http://trac.macosforge.org/projects/ruby/changeset/2462
Author:   lsansonetti at apple.com
Date:     2009-09-03 15:17:39 -0700 (Thu, 03 Sep 2009)
Log Message:
-----------
fixed a bug in the ivar slot relocation strategy

Modified Paths:
--------------
    MacRuby/trunk/vm.h

Modified: MacRuby/trunk/vm.h
===================================================================
--- MacRuby/trunk/vm.h	2009-09-03 20:43:38 UTC (rev 2461)
+++ MacRuby/trunk/vm.h	2009-09-03 22:17:39 UTC (rev 2462)
@@ -309,7 +309,7 @@
     for (i = obj->num_slots + 1; i < new_num_slot; i++) {
 	obj->slots[i] = Qundef;
     }
-    obj->num_slots = new_num_slot;
+    obj->num_slots = new_num_slot + 1;
 }
 
 static inline VALUE
@@ -317,7 +317,7 @@
 {
     struct RObject *robj = (struct RObject *)obj;
     assert(slot >= 0);
-    if (robj->num_slots < (unsigned int)slot) {
+    if ((unsigned int)slot >= robj->num_slots)  {
 	return Qnil;
     }
     return robj->slots[slot];
@@ -328,7 +328,7 @@
 {
     struct RObject *robj = (struct RObject *)obj;
     assert(slot >= 0);
-    if (robj->num_slots < (unsigned int)slot) {
+    if ((unsigned int)slot >= robj->num_slots)  {
 	rb_vm_regrow_robject_slots(robj, (unsigned int)slot);
     }
     GC_WB(&robj->slots[slot], val);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090903/135b5a35/attachment-0001.html>


More information about the macruby-changes mailing list