[Bug #611] loop { BEGIN {} } dumps core

Bug #611: loop { BEGIN {} } dumps core

e$B5/I<<Te(B: Shyouhei U.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: core

e$B<!$N$h$&$K$9$k$He(B core e$B$rEG$-$^$9!#e(B

% gdb --args ~/target/trunk/bin/ruby -e’loop{BEGIN{}}’
GNU gdb 6.4.90-debian
Copyright © 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
welcome to change it and/or distribute copies of it under certain
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
This GDB was configured as “x86_64-linux-gnu”…Using host libthread_db
library “/lib/libthread_db.so.1”.

(gdb) run
Starting program: /home/shyouhei/target/trunk/bin/ruby
[Thread debugging using libthread_db enabled]
[New Thread 47661522453936 (LWP 18756)]
[New Thread 1073756512 (LWP 18759)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47661522453936 (LWP 18756)]
0x00000000004565ff in ruby_yyparse (parser=0x7bfef0) at
3617 nd_set_line($$->nd_body->nd_body,
(gdb) bt
#0 0x00000000004565ff in ruby_yyparse (parser=0x7bfef0) at
#1 0x0000000000459200 in yycompile0 (arg=8126192, tracing=0) at
#2 0x0000000000510a49 in ruby_suppress_tracing (func=0x4590f3
, arg=8126192, always=2) at
#3 0x00000000004593bf in yycompile (parser=0x7bfef0, f=0x6f5b18 “-e”,
line=1) at /home/shyouhei/ruby/trunk/parse.y:5021
#4 0x00000000004596e5 in rb_parser_compile_string (vparser=8143240,
f=0x6f5b18 “-e”, s=7297840, line=1) at
#5 0x00000000004a0e58 in process_options (arg=140735786351248) at
#6 0x0000000000508c3e in rb_vm_call_cfunc (recv=7572320, func=0x4a070b
<process_options>, arg=140735786351248, blockptr=0x0, filename=7298080)
at /home/shyouhei/ruby/trunk/vm.c:1323
#7 0x00000000004a20ee in ruby_process_options (argc=2,
argv=0x7fff9a8d7ce8) at /home/shyouhei/ruby/trunk/ruby.c:1541
#8 0x0000000000416236 in ruby_options (argc=2, argv=0x7fff9a8d7ce8) at
#9 0x000000000041509f in main (argc=2, argv=0x7fff9a8d7ce8) at

e$B%A%1%C%He(B #611 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r19640.