Project

General

Profile

Actions

Bug #608

closed

duplicated when clause

Added by mame (Yusuke Endoh) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-dev:36616]

Description

=begin
遠藤です。

when 節に同じ値があるときの挙動が 1.8 と 1.9 で異なるようです。

$ 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 のバグではないかと思います。
以下のパッチをコミットしてもいいでしょうか。

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);
    

--
Yusuke ENDOH
=end

Actions #1

Updated by ko1 (Koichi Sasada) over 15 years ago

=begin
 ささだです.

Yusuke ENDOH wrote:

1.9 のバグではないかと思います。
以下のパッチをコミットしてもいいでしょうか。

 はい.お願いします.

--
// SASADA Koichi at atdot dot net

=end

Actions #2

Updated by mame (Yusuke Endoh) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r19612.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0