summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-22 11:00:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-22 11:00:24 +0000
commitbe953b4d1ce3f0dfc7f24c84ec7a51e027102557 (patch)
tree0f2cad7e7f269e5f9307ba2b5b4899b0bbbf6d4e /cont.c
parentd8af9c854d4c6723afb4a3295b8a21bdce8cc06e (diff)
* cont.c (cont_capture): add volatile.
On clang -O, it is needed to avoid the optimization. With this and llvm/clang's recent fix, clang 3.0 can build ruby-trunk with -O option. * cont.c (cont_capture): use for-loop. * array.c (rb_ary_each): add volatile and use it. * vm_insnhelper.c (vm_call_cfunc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cont.c b/cont.c
index f5e6698..cdbe590 100644
--- a/cont.c
+++ b/cont.c
@@ -437,7 +437,7 @@ cont_capture(volatile int *stat)
cont_save_machine_stack(th, cont);
if (ruby_setjmp(cont->jmpbuf)) {
- VALUE value;
+ volatile VALUE value;
value = cont->value;
if (cont->argc == -1) rb_exc_raise(value);
@@ -654,9 +654,10 @@ cont_restore_1(rb_context_t *cont)
}
#endif
if (cont->machine_stack_src) {
+ size_t i;
FLUSH_REGISTER_WINDOWS;
- MEMCPY(cont->machine_stack_src, cont->machine_stack,
- VALUE, cont->machine_stack_size);
+ for (i = 0; i < cont->machine_stack_size; i++)
+ cont->machine_stack_src[i] = cont->machine_stack[i];
}
#ifdef __ia64