VM::InstructionSequence.load may dump core

e$B1sF#$G$9!#e(B

VM::InstructionSequence.compile e$B$7$?$b$N$re(B to_a e$B$7$?$b$N$re(B
load e$B$7$Fe(B eval e$B$9$k$HMn$A$k$3$H$,$"$j$^$9!#e(B

$ ./ruby -e ’
VM::InstructionSequence.load(
VM::InstructionSequence.compile(<<-SRC).to_a
def foo
begin
raise
return
rescue
end
begin
rescue
end
end
SRC
).eval
foo

:7: [BUG] Stack consistency error (sp: 10, bp: 9)
ruby 1.9.0 (2008-06-25 revision 17573) [i686-linux]

– control frame ----------
c:0004 p:0016 s:0010 b:0009 l:000008 d:000008 METHOD :7
c:0003 p:0052 s:0006 b:0006 l:000005 d:000005 TOP -e:16
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
:private_class_method
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17

DBG> : “:7:in foo'" DBG> : "-e:16:in'”
– backtrace of native function call (Use addr2line) –
0x8101525
0x812822e
0x812828b
0x80fc09d
0x80fcb0b
0x80fcd00
0x805a03f
0x805b94e
0x8058a01
0xb7e0eea8
0x8058911

e$B%"%!<%H$7$^$7$?e(B

compile e$B;~$Ke(B ADD_ADJUST_RESTORE e$B$,$"$C$?$N$,e(B to_a
e$B$N;~E@$Ge(B
e$B>C$($F$$$k$?$a!"e(Bload e$B$9$k;~$K%9%?%C%/$N?<$5$N?dO@$K<:GT$7!"e(B
CATCH_TYPE_RESCUE e$B$Ne(B sp e$B$,JQ$K$J$k$N$,860x$G$9!#e(B

e$B%"%I%[%C%/$J=$@5$H$7$F$O!“e(BADD_ADJUST_RESTORE e$B$re(B ADD_ADJUST
e$B$Ke(B
e$B$9$k$H$+!”?dO@$KMj$i$:%P%$%H%3!<%I>e$Ne(B CATCH_TYPE_RESCUE e$B$Ne(B
sp e$B$r:NMQ$9$k$H$+$,9M$($i$l$^$9$,!"e(Biseq_set_sequence
e$B$N?dO@$re(B
e$B8-$/$9$k$N$,$$$$$+$H;W$$$^$9!#e(B

e$B$5$5$@$5$s$K$Oe(B IRC e$B$G2?2s$+8@$C$?5$$,$7$^$9$,!"5-O?$K;D$9e(B

e$B$?$a$K%a!<%k$7$^$9!#e(B