[前][次][番号順一覧][スレッド一覧]

ruby-changes:40042

From: nobu <ko1@a...>
Date: Wed, 14 Oct 2015 14:11:55 +0900 (JST)
Subject: [ruby-changes:40042] nobu:r52123 (trunk): iseq.c: list of keywords [Fix GH-1056]

nobu	2015-10-14 14:11:44 +0900 (Wed, 14 Oct 2015)

  New Revision: 52123

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52123

  Log:
    iseq.c: list of keywords [Fix GH-1056]
    
    * iseq.c (rb_insn_operand_intern): change kw in callinfo disasm from the
      number of keyword arguments to an ordered list of the keywords used.
      [Feature #11589]

  Modified files:
    trunk/ChangeLog
    trunk/iseq.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52122)
+++ ChangeLog	(revision 52123)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Oct 14 14:11:42 2015  Brian Black  <bblack@v...>
+
+	* iseq.c (rb_insn_operand_intern): change kw in callinfo disasm from the
+	  number of keyword arguments to an ordered list of the keywords used.
+	  [Feature #11589]
+
 Wed Oct 14 13:58:44 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_nextc): send a warning to ripper, not to STDERR
Index: iseq.c
===================================================================
--- iseq.c	(revision 52122)
+++ iseq.c	(revision 52123)
@@ -1292,7 +1292,9 @@ rb_insn_operand_intern(const rb_iseq_t * https://github.com/ruby/ruby/blob/trunk/iseq.c#L1292
 	    rb_ary_push(ary, rb_sprintf("argc:%d", ci->orig_argc));
 
 	    if (ci->flag & VM_CALL_KWARG) {
-		rb_ary_push(ary, rb_sprintf("kw:%d", ((struct rb_call_info_with_kwarg *)ci)->kw_arg->keyword_len));
+		struct rb_call_info_kw_arg *kw_args = ((struct rb_call_info_with_kwarg *)ci)->kw_arg;
+		VALUE kw_ary = rb_ary_new_from_values(kw_args->keyword_len, kw_args->keywords);
+		rb_ary_push(ary, rb_sprintf("kw:[%"PRIsVALUE"]", rb_ary_join(kw_ary, rb_str_new2(","))));
 	    }
 
 	    if (ci->flag) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]