ruby-changes:3140
From: ko1@a...
Date: 25 Dec 2007 05:27:52 +0900
Subject: [ruby-changes:3140] ko1 - Ruby:r14632 (trunk): * compile.c (iseq_compile): clear local table if node == 0.
ko1 2007-12-25 05:27:10 +0900 (Tue, 25 Dec 2007)
New Revision: 14632
Modified files:
trunk/ChangeLog
trunk/compile.c
trunk/vm.c
Log:
* 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.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/compile.c?r1=14632&r2=14631
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14632&r2=14631
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/vm.c?r1=14632&r2=14631
Index: ChangeLog
===================================================================
--- ChangeLog (revision 14631)
+++ ChangeLog (revision 14632)
@@ -1,3 +1,10 @@
+Tue Dec 25 05:24:12 2007 Koichi Sasada <ko1@a...>
+
+ * 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.
+
Tue Dec 25 04:23:32 2007 Tanaka Akira <akr@f...>
* parse.y (rb_id2str): fill klass of returned string as rb_cString.
Index: compile.c
===================================================================
--- compile.c (revision 14631)
+++ compile.c (revision 14632)
@@ -145,6 +145,7 @@
if (node == 0) {
COMPILE(ret, "nil", node);
+ iseq_set_local_table(iseq, 0);
}
else if (nd_type(node) == NODE_SCOPE) {
/* iseq type of top, method, class, block */
Index: vm.c
===================================================================
--- vm.c (revision 14631)
+++ vm.c (revision 14632)
@@ -1664,10 +1664,15 @@
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->cfp->iseq = 0;
th->cfp->proc = 0;
th->cfp->block_iseq = 0;
+#endif
th->status = THREAD_RUNNABLE;
th->errinfo = Qnil;
@@ -1847,6 +1853,8 @@
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 @@
th->machine_stack_maxsize /= 2;
th->machine_register_stack_maxsize = th->machine_stack_maxsize;
#endif
- rb_thread_set_current_raw(th);
}
/* top self */
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml