Skip to content

Commit 011347e

Browse files
author
normal
committed
iseq.c (iseq_data_to_ary): dump kw_arg as symbol
Fix RubyVM::InstructionSequence#to_a after r49517 Keywords were made symbols to fix [Bug ruby#10831] [ruby-core:68031], so we should dump symbols as-is instead of attempting to convert them from IDs * iseq.c (iseq_data_to_ary): dump kw_arg as symbol * test/-ext-/iseq_load/test_iseq_load.rb: test kw_arg roundtrip [ruby-core:69891] [Bug ruby#11338] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent fe94eaa commit 011347e

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Diff for: ChangeLog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Wed Jul 8 04:42:27 2015 Eric Wong <e@80x24.org>
2+
3+
* iseq.c (iseq_data_to_ary): dump kw_arg as symbol
4+
* test/-ext-/iseq_load/test_iseq_load.rb: test kw_arg roundtrip
5+
[ruby-core:69891] [Bug #11338]
6+
17
Tue Jul 7 18:18:41 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
28

39
* random.c (fill_random_bytes_syscall): fix compile error.

Diff for: iseq.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
17951795

17961796
orig_argc -= ci->kw_arg->keyword_len;
17971797
for (i = 0; i < ci->kw_arg->keyword_len; i++) {
1798-
rb_ary_push(kw, ID2SYM(ci->kw_arg->keywords[i]));
1798+
rb_ary_push(kw, ci->kw_arg->keywords[i]);
17991799
}
18001800
rb_hash_aset(e, ID2SYM(rb_intern("kw_arg")), kw);
18011801
}

Diff for: test/-ext-/iseq_load/test_iseq_load.rb

+9
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ def test_break_ensure_def_method
8686
assert_iseq_roundtrip(src)
8787
end
8888

89+
def test_kwarg
90+
assert_iseq_roundtrip <<-'end;'
91+
def foo(kwarg: :foo)
92+
kwarg
93+
end
94+
foo(kwarg: :bar)
95+
end;
96+
end
97+
8998
# FIXME: still failing
9099
def test_require_integration
91100
skip "iseq loader require integration tests still failing"

0 commit comments

Comments
 (0)