diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 13:15:34 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 13:15:34 +0000 |
commit | 0167d0e6acf2a71003253b47b21b2d7cae97259e (patch) | |
tree | 8a3d0e5c973bfd413c04bb66c20d5f1322395da4 /compile.c | |
parent | ae515c9ad649dbf4f19c5712988f025b5ebdc2d9 (diff) | |
download | ruby-0167d0e6acf2a71003253b47b21b2d7cae97259e.tar.gz ruby-0167d0e6acf2a71003253b47b21b2d7cae97259e.tar.xz ruby-0167d0e6acf2a71003253b47b21b2d7cae97259e.zip |
* compile.c (iseq_set_sequence): check duplicated when clauses.
[ruby-dev:36616]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1349,7 +1349,12 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) 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))); + } + else { + rb_warning("duplicated when clause is ignored"); + } } generated_iseq[pos + 1 + j] = map; iseq_add_mark_object(iseq, map); |