[ruby-cvs:55757] ko1:r48608 (trunk): * vm_args.c: fix backtrace location for keyword related exceptions.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Thu Nov 27 19:15:48 JST 2014


ko1	2014-11-27 19:15:47 +0900 (Thu, 27 Nov 2014)

  New Revision: 48608

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

  Log:
    * vm_args.c: fix backtrace location for keyword related exceptions.
      For example, the following program
        def foo(k1: 1); end # line 1
                foo(k2: 2)          # line 2
      causes "unknown keyword: k2 (ArgumentError)".
      Before this patch, the backtrace location is only line 2.
      However, error should be located at line 1 (over line 2 in
      stack trace). This patch fix this problem.
    * class.c (rb_keyword_error_new): separate exception creation logic
      from rb_keyword_error(), to use in vm_args.c.
    * vm_insnhelper.c (rb_arg_error_new): rename to rb_arity_error_new().
    * vm_args.c (argument_arity_error): rename to argument_arity_error().
    * vm_args.c (arugment_kw_error): added to fix backtrace.
    * test/ruby/test_keyword.rb: add tests.

  Modified files:
    trunk/ChangeLog
    trunk/class.c
    trunk/test/ruby/test_keyword.rb
    trunk/vm_args.c
    trunk/vm_insnhelper.c


More information about the ruby-cvs mailing list