diff --git a/ChangeLog b/ChangeLog index f1a15d5145..37e61de052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 1 12:05:53 2016 Nobuyoshi Nakada + + * compile.c (remove_unreachable_chunk): remove unreferred label + to optimize away unreachable chunk. + Fri Jan 1 11:42:57 2016 James Edward Gray II * lib/csv.rb (CSV): Add a liberal_parsing option. 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;