From: nobu.nakada@... Date: 2003-09-01T12:32:34+09:00 Subject: [ruby-dev:21295] volatile pointer/variable なかだです。 しばらく前の変更でrb_thread_start_0()のsaved_blockがvolatileへ のポインタになりましたが、setjmp()/longjmp()でsaved_block自身の 値を保証するためであれば、ポインタの指す先をvolatileにしても意 味がないと思います。 Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.526 diff -u -2 -p -r1.526 eval.c --- eval.c 31 Aug 2003 13:47:47 -0000 1.526 +++ eval.c 1 Sep 2003 03:27:13 -0000 @@ -9337,5 +9337,5 @@ rb_thread_start_0(fn, arg, th_arg) volatile rb_thread_t th = th_arg; volatile VALUE thread = th->thread; - volatile struct BLOCK* saved_block = 0; + struct BLOCK *volatile saved_block = 0, *block; enum thread_status status; int state; @@ -9395,10 +9395,10 @@ rb_thread_start_0(fn, arg, th_arg) rb_thread_remove(th); - while (saved_block) { - volatile struct BLOCK *tmp = saved_block; + for (block = saved_block; block;) { + struct BLOCK *tmp = block; if (tmp->frame.argc > 0) free(tmp->frame.argv); - saved_block = tmp->prev; + block = tmp->prev; free((void*)tmp); } -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦