summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-16 08:40:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-16 08:40:42 +0000
commit6339ac02acdc2f96b1ac3d9a7562fcfafec478cc (patch)
tree2a1592e45d0465bce2a414237d5aeebd70b9258c /compile.c
parent5cf43106165b2e7e27380c592e53756d2504fbf0 (diff)
compile.c: optimize leave
* compile.c (iseq_peephole_optimize): optimize replaced leave instruction copied to jump instruction too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index c34126a..ce0b932 100644
--- a/compile.c
+++ b/compile.c
@@ -1956,7 +1956,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
unref_destination(iobj);
REPLACE_ELEM((LINK_ELEMENT *)iobj, (LINK_ELEMENT *)eiobj);
INSERT_ELEM_NEXT((LINK_ELEMENT *)eiobj, (LINK_ELEMENT *)popiobj);
- iobj = popiobj;
+ iobj = eiobj;
+ goto again;
}
/*
* useless jump elimination (if/unless destination):