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
commit18748d168059353e909c7e53407735c37548737b (patch)
tree16103c4b159ea61a5729614590e3d0bb2590b471 /compile.c
parent9c63aecfa75d94efb2f5d86d12023ef6ef85af85 (diff)
downloadruby-18748d168059353e909c7e53407735c37548737b.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;