From: "K.Sasada" Date: 2003-07-31T12:52:54+09:00 Subject: Re: Segfault with map operation on 1.8p5 [ Segfault with map operation on 1.8p5 ] Thu, 31 Jul 2003 11:41:33 +0900 > The following snippet is a silly thing to do, but I > thought it might be worth mentioning. It segfaults on > 1.8p5, but not 1.6.x: > > a = [1,2,3,4] > h = {} > a.map{ |e| h[e] = a.shift } This problem is solved by following patch for ruby 1.8.0 p5. regards, -- // SASADA Koichi @ namikilab.tuat.ac.jp // // Thanks to unak :) --- array.c.org Thu Jul 31 03:20:06 2003 +++ array.c Thu Jul 31 03:29:54 2003 @@ -1197,9 +1197,8 @@ rb_ary_collect(ary) return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr); } - len = RARRAY(ary)->len; collect = rb_ary_new2(len); - for (i=0; ilen; i++) { rb_ary_push(collect, rb_yield(RARRAY(ary)->ptr[i])); } return collect;