# Next in while may dumps core

**URL:** <https://www.ruby-forum.com/t/next-in-while-may-dumps-core/127339>\
**Category:** Development\
**Created:** [January 28, 2008, 1:01pm UTC](https://www.ruby-forum.com/t/next-in-while-may-dumps-core/127339 "2008-01-28T13:01:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yusuke\_ENDOH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/c89c15/32.png) [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Post date:** [January 28, 2008, 1:01pm UTC](https://www.ruby-forum.com/t/next-in-while-may-dumps-core/127339/1 "2008-01-28T13:01:05Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B

1.9 e$B$,0J2\<$GMn$A$^$9!#$^$?!"e(Bnext e$B$re(B redo  
e$B$KJQ$($F$bMn$A$^$9!#e(B

$ ./ruby -e ’  
def foo  
while true  
begin  
yield  
next  
rescue  
end  
end  
rescue  
retry  
end

foo { raise }  
’  
-e:5: [BUG] Segmentation fault  
ruby 1.9.0 (2008-01-28 revision 15294) [i686-linux]

## – control frame ---------- c:0004 p:0003 s:0008 b:0009 l:000008 d:000008 METHOD -e:5 c:0003 p:0012 s:0006 b:0006 l:000005 d:000005 TOP -e:14 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17

## DBG\> : “-e:14:in `’” – backtrace of native function call (Use addr2line) – 0x80ef855 0x810e2ce 0x810e32b 0x80be760 0xffffe440 0x80ed264 0x80ed59d 0x805a7f9 0x805e940 0x8058221 0xb7e00ea8 0x8058131

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

e$B$"$s$^$j$A$c$s$HDI$C$F$$$^$;$s$,!"e(BNODE\_NEXT e$B$de(B \_REDO  
e$B$re(B while e$B$NCf$Ge(B  
e$B%3%s%Q%$%k$9$k$H$-!"e(Bpoped  
e$B$rL5;k$7$F$$$k$?$aH/@8$9$kLdBj$N$h$&$G$9!#e(B

# Index: compile.c

— compile.c (revision 15294)  
+++ compile.c (working copy)  
@@ -3049,6 +3049,10 @@  
ADD\_ADJUST(ret, nd\_line(node), iseq-\>compile\_data-\>redo\_label);  
ADD\_INSNL(ret, nd\_line(node), jump,  
iseq-\>compile\_data-\>start\_label);  
ADD\_ADJUST\_RESTORE(ret, splabel);  
+

- 

```
 if (!poped) {

```

- ADD\_INSN(ret, nd\_line(node), putnil);
- 

```
 }

```

}  
else if (iseq-\>compile\_data-\>end\_label) {  
LABEL \*splabel = NEW\_LABEL(0);  
@@ -3110,6 +3114,10 @@  
add\_ensure\_iseq(ret, iseq);  
ADD\_INSNL(ret, nd\_line(node), jump,  
iseq-\>compile\_data-\>redo\_label);  
ADD\_ADJUST\_RESTORE(ret, splabel);
- 
- 

```
 if (!poped) {

```

- ADD\_INSN(ret, nd\_line(node), putnil);
- 

```
 }

```

}  
else if (iseq-\>type == ISEQ\_TYPE\_EVAL) {  
redo\_in\_eval:
