aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-01 03:05:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-01 03:05:55 +0000
commit009473757550894ecc0579006a8a590eb81435fa (patch)
tree16103c4b159ea61a5729614590e3d0bb2590b471 /compile.c
parentf18f940802752fb8997164d4440c488fb1396f35 (diff)
downloadruby-009473757550894ecc0579006a8a590eb81435fa.tar.gz
compile.c: remove unreferred label
* compile.c (remove_unreachable_chunk): remove unreferred label to optimize away unreachable chunk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 5c6c5f5f32..b361da1164 100644
--- a/compile.c
+++ b/compile.c
@@ -1968,6 +1968,9 @@ remove_unreachable_chunk(LINK_ELEMENT *i)
break;
}
}
+ else if (i->type == ISEQ_ELEMENT_LABEL) {
+ if (((LABEL *)i)->refcnt > 0) break;
+ }
else break;
REMOVE_ELEM(i);
removed = 1;