From: nobu.nokada@... Date: 2003-08-22T20:30:32+09:00 Subject: Re: [crash BUG] the latest ruby 1.8 (2003-08-22) give SIGBUS Hi, At Fri, 22 Aug 2003 20:17:29 +0900, Ville Mattila wrote: > When I'm trying to compile the latest sources I get at miniruby stage the following > dump > > r ./ext/extmk.rb --extstatic="" --dest-dir="" --make="make" --mflags="" --make-flags="" > Starting program: /workarea2/stonebeat/work/m_o/mulperi/nb/ruby/ruby-cvs/ruby/./miniruby ./ext/extmk.rb --extstatic="" --dest-dir="" --make="make" --mflags="" --make-flags="" > > Program received signal SIGBUS, Bus error. > rb_yield_0 (val=1604896, self=1069304, klass=0, flags=0, avalue=2) > at eval.c:4109 > 4109 val = RARRAY(val)->ptr[0]; This patch woudl fix it. Index: string.c =================================================================== RCS file: /cvs/ruby/src/ruby/string.c,v retrieving revision 1.173 diff -u -2 -p -r1.173 string.c --- string.c 22 Aug 2003 08:09:57 -0000 1.173 +++ string.c 22 Aug 2003 09:49:45 -0000 @@ -3031,9 +3031,6 @@ scan_once(str, pat, start) *start = END(0); } - if (regs->num_regs == 1) { - return rb_reg_nth_match(0, match); - } result = rb_ary_new2(regs->num_regs); - for (i=1; i < regs->num_regs; i++) { + for (i=0; i < regs->num_regs; i++) { rb_ary_push(result, rb_reg_nth_match(i, match)); } -- Nobu Nakada