Modified: MacRuby/trunk/proc.c (2818 => 2819)
--- MacRuby/trunk/proc.c 2009-10-15 23:50:21 UTC (rev 2818)
+++ MacRuby/trunk/proc.c 2009-10-15 23:51:16 UTC (rev 2819)
@@ -1391,6 +1391,7 @@
rb_vm_binding_t *binding = (rb_vm_binding_t *)xmalloc(
sizeof(rb_vm_binding_t));
+ binding->block = NULL;
GC_WB(&binding->self, block->self);
GC_WB(&binding->locals, block->locals);
Modified: MacRuby/trunk/vm.cpp (2818 => 2819)
--- MacRuby/trunk/vm.cpp 2009-10-15 23:50:21 UTC (rev 2818)
+++ MacRuby/trunk/vm.cpp 2009-10-15 23:51:16 UTC (rev 2819)
@@ -2562,7 +2562,10 @@
rb_vm_add_binding_lvar_use(binding, current_block, parent_var_uses);
- GET_VM()->push_current_binding(binding);
+ RoxorVM *vm = GET_VM();
+ GC_WB(&binding->block, vm->current_block());
+
+ vm->push_current_binding(binding);
}
extern "C"
@@ -3274,6 +3277,8 @@
RoxorCompiler::shared->set_dynamic_class(true);
}
+ vm->add_current_block(binding != NULL ? binding->block : NULL);
+
struct Finally {
RoxorVM *vm;
bool old_dynamic_class;
@@ -3289,6 +3294,7 @@
RoxorCompiler::shared->set_dynamic_class(old_dynamic_class);
vm->set_current_top_object(old_top_object);
vm->set_current_class(old_class);
+ vm->pop_current_block();
}
} finalizer(vm, old_dynamic_class, old_class, old_top_object);
Modified: MacRuby/trunk/vm.h (2818 => 2819)
--- MacRuby/trunk/vm.h 2009-10-15 23:50:21 UTC (rev 2818)
+++ MacRuby/trunk/vm.h 2009-10-15 23:51:16 UTC (rev 2819)
@@ -53,6 +53,7 @@
typedef struct {
VALUE self;
+ rb_vm_block_t *block;
rb_vm_local_t *locals;
} rb_vm_binding_t;