[Bug:1.9] duplicated when clause

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

when e$B@a$KF1$8CM$,$"$k$H$-$N5sF0$,e(B 1.8 e$B$He(B 1.9
e$B$G0[$J$k$h$&$G$9!#e(B

$ ruby18 -e ’
case 1
when 1 then p :foo
when 1 then p :bar
end

:foo

$ ruby19 -e ’
case 1
when 1 then p :foo
when 1 then p :bar
end

:bar

1.9 e$B$N%P%0$G$O$J$$$+$H;W$$$^$9!#e(B
e$B0J2<$N%Q%C%A$r%3%_%C%H$7$F$b$$$$$G$7$g$&$+!#e(B

Index: compile.c

— compile.c (revision 19604)
+++ compile.c (working copy)
@@ -1349,7 +1349,9 @@
rb_compile_error(RSTRING_PTR(iseq->filename),
iobj->line_no,
“unknown label”);
}

  •    rb_hash_aset(map, obj, INT2FIX(lobj->position - (pos+len)));
    
  •    if (!st_lookup(rb_hash_tbl(map), obj, 0)) {
    
  •        rb_hash_aset(map, obj, INT2FIX(lobj->position - 
    

(pos+len)));

  •    }
         }
         generated_iseq[pos + 1 + j] = map;
         iseq_add_mark_object(iseq, map);

e$B!!$5$5$@$G$9!%e(B

Yusuke ENDOH wrote:

1.9 e$B$N%P%0$G$O$J$$$+$H;W$$$^$9!#e(B
e$B0J2<$N%Q%C%A$r%3%_%C%H$7$F$b$$$$$G$7$g$&$+!#e(B

e$B!!$O$$!%$*4j$$$7$^$9!%e(B

e$B%A%1%C%He(B #608 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r19612.

http://redmine.ruby-lang.org/issues/show/608