summaryrefslogtreecommitdiff
path: root/array.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 /array.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 'array.c')
-rw-r--r--array.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/array.c b/array.c
index 5fb0c64cb3..82ae7efdb4 100644
--- a/array.c
+++ b/array.c
@@ -1468,9 +1468,10 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
*/
VALUE
-rb_ary_each(VALUE ary)
+rb_ary_each(VALUE array)
{
long i;
+ volatile VALUE ary = array;
RETURN_ENUMERATOR(ary, 0, 0);
for (i=0; i<RARRAY_LEN(ary); i++) {