# Peephole\_optimize ignores ADJUST

**URL:** <https://www.ruby-forum.com/t/peephole-optimize-ignores-adjust/138396>\
**Category:** Development\
**Created:** [May 22, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/peephole-optimize-ignores-adjust/138396 "2008-05-22T16:21:16Z")\
**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:** [May 22, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/peephole-optimize-ignores-adjust/138396/1 "2008-05-22T16:21:16Z")

</div>

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

e$B0J2\<$Ge(B SEGV e$B$7$^$9!#e(B

$ ./ruby -e ’  
1.times do  
begin  
ensure  
redo unless false  
end  
end  
’  
-e:4: [BUG] Segmentation fault  
ruby 1.9.0 (2008-05-22 revision 16531) [i686-linux]

## – stack frame ------------ – control frame ---------- c:0006 p:0001 s:302711808 b:0011 l:000005 d:000010 BLOCK -e:4 c:0005 p:---- s:0011 b:0011 l:000010 d:000010 FINISH :class\_eval c:0004 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC :times c:0003 p:0008 s:0006 b:0006 l:000005 d:000005 TOP -e:2 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

Segmentation fault

ISEQ\_ELEMENT\_ADJUST e$B$,DI2C$5$l$?$N$K!"e(Bpeephole\_optimize e$B$,e(B  
ISEQ\_ELEMENT\_INSN e$B$7$+C5$5$J$$$3$H$,860x$N$h$&$G$9!#e(B

# Index: compile.c

— compile.c (revision 16534)  
+++ compile.c (working copy)  
@@ -1362,7 +1362,7 @@

```
 list = lobj->link.next;
 while (list) {

```

- if (list-\>type == ISEQ\_ELEMENT\_INSN) {

- if (list-\>type == ISEQ\_ELEMENT\_INSN || list-\>type ==  
ISEQ\_ELEMENT\_ADJUST) {  
break;  
}  
list = list-\>next;  
@@ -1376,7 +1376,7 @@  
LINK\_ELEMENT \*list = iobj-\>link.next;

- if (list-\>type == ISEQ\_ELEMENT\_INSN) {

- if (list-\>type == ISEQ\_ELEMENT\_INSN || list-\>type ==  
ISEQ\_ELEMENT\_ADJUST) {  
return list;  
}  
list = list-\>next;  
@@ -1390,7 +1390,7 @@  
LINK\_ELEMENT \*list = iobj-\>link.prev;

- if (list-\>type == ISEQ\_ELEMENT\_INSN) {

- if (list-\>type == ISEQ\_ELEMENT\_INSN || list-\>type ==  
ISEQ\_ELEMENT\_ADJUST) {  
return list;  
}  
list = list-\>prev;
