summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 20:27:10 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 20:27:10 +0000
commit95ca3f72a8a72126ab412f5c58fd2c8f6e03bbed (patch)
tree3edf55b5163c4bc8ec02c121bc680021cf321383 /vm.c
parentc94a89a739f32e9fcf64e2170b973717242090e3 (diff)
* compile.c (iseq_compile): clear local table if node == 0.
a patch from Yusuke ENDOH <mame AT tsg.ne.jp> * vm.c: clear VM stack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/vm.c b/vm.c
index 9eda8014c0..3fa51c27f5 100644
--- a/vm.c
+++ b/vm.c
@@ -1664,10 +1664,15 @@ th_init2(rb_thread_t *th)
th->stack = thread_recycle_stack(th->stack_size);
th->cfp = (void *)(th->stack + th->stack_size);
- th->cfp--;
+ vm_push_frame(th, 0, FRAME_MAGIC_TOP, Qnil, 0, 0,
+ th->stack, 0, 0);
+ vm_push_frame(th, 0, FRAME_MAGIC_TOP, Qnil, 0, 0,
+ th->cfp->sp, 0, 0);
+
+#if 0
th->cfp->pc = 0;
- th->cfp->sp = th->stack + 1;
+ th->cfp->sp = th->stack;
th->cfp->bp = 0;
th->cfp->lfp = th->stack;
*th->cfp->lfp = 0;
@@ -1677,6 +1682,7 @@ th_init2(rb_thread_t *th)
th->cfp->iseq = 0;
th->cfp->proc = 0;
th->cfp->block_iseq = 0;
+#endif
th->status = THREAD_RUNNABLE;
th->errinfo = Qnil;
@@ -1847,6 +1853,8 @@ Init_BareVM(void)
rb_thread_t *th = ALLOC(rb_thread_t);
MEMZERO(th, rb_thread_t, 1);
+ rb_thread_set_current_raw(th);
+
vm_init2(vm);
ruby_current_vm = vm;
@@ -1859,7 +1867,6 @@ Init_BareVM(void)
th->machine_stack_maxsize /= 2;
th->machine_register_stack_maxsize = th->machine_stack_maxsize;
#endif
- rb_thread_set_current_raw(th);
}
/* top self */