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

ruby-changes:27392

From: nobu <ko1@a...>
Date: Sun, 24 Feb 2013 07:51:55 +0900 (JST)
Subject: [ruby-changes:27392] nobu:r39444 (trunk): compile.c: no keyword check if kw_rest

nobu	2013-02-24 07:51:45 +0900 (Sun, 24 Feb 2013)

  New Revision: 39444

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

  Log:
    compile.c: no keyword check if kw_rest
    
    * compile.c (iseq_set_arguments): no keyword check if any keyword rest
      argument exists, even unnamed.  [ruby-core:52744] [Bug #7922]

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/test/ruby/test_syntax.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39443)
+++ ChangeLog	(revision 39444)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Feb 24 07:51:28 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (iseq_set_arguments): no keyword check if any keyword rest
+	  argument exists, even unnamed.  [ruby-core:52744] [Bug #7922]
+
+Sun Feb 24 07:50:53 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (iseq_set_arguments): no keyword check if any keyword rest
+	  argument exists, even unnamed.  [ruby-core:52744] [Bug #7922]
+
 Sat Feb 23 16:51:00 2013  Zachary Scott  <zachary@z...>
 
 	* thread.c: Documentation for Thread#backtrace_locations
Index: compile.c
===================================================================
--- compile.c	(revision 39443)
+++ compile.c	(revision 39444)
@@ -1204,7 +1204,6 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/compile.c#L1204
 	else if (args->kw_rest_arg) {
 	    iseq->arg_keyword = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
 	    COMPILE(optargs, "kwarg", args->kw_rest_arg);
-	    iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
 	    ADD_INSN(optargs, nd_line(args->kw_rest_arg), pop);
 	}
 	else {
Index: test/ruby/test_syntax.rb
===================================================================
--- test/ruby/test_syntax.rb	(revision 39443)
+++ test/ruby/test_syntax.rb	(revision 39444)
@@ -77,6 +77,9 @@ class TestSyntax < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L77
       eval("def o.m(k: 0) k end")
     end
     assert_equal(42, o.m(k: 42), '[ruby-core:45744]')
+    bug7922 = '[ruby-core:52744] [Bug #7922]'
+    def o.bug7922(**) end
+    assert_nothing_raised(ArgumentError, bug7922) {o.bug7922(foo: 42)}
   end
 
   def test_keyword_splat

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

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