[#68478] Looking for MRI projects for Ruby Google Summer of Code 2015 — Tony Arcieri <bascule@...>
Hi ruby-core,
10 messages
2015/03/10
[#68480] Re: Looking for MRI projects for Ruby Google Summer of Code 2015
— SASADA Koichi <ko1@...>
2015/03/10
I have.
[#68549] Re: Looking for MRI projects for Ruby Google Summer of Code 2015
— SASADA Koichi <ko1@...>
2015/03/17
I sent several ideas on previous, mail, but they are seems rejected?
[#68493] [Ruby trunk - Feature #10532] [PATCH] accept_nonblock supports "exception: false" — nobu@...
Issue #10532 has been updated by Nobuyoshi Nakada.
5 messages
2015/03/11
[#68503] Re: [Ruby trunk - Feature #10532] [PATCH] accept_nonblock supports "exception: false"
— Eric Wong <normalperson@...>
2015/03/12
Committed as r49948.
[#68504] Re: [Ruby trunk - Feature #10532] [PATCH] accept_nonblock supports "exception: false"
— Nobuyoshi Nakada <nobu@...>
2015/03/12
On 2015/03/12 12:08, Eric Wong wrote:
[#68506] Seven stacks (and two questions) — Jakub Trzebiatowski <jaktrze1@...>
The Ruby Hacking Guide says that Ruby has=E2=80=A6 seven stacks. Is it =
5 messages
2015/03/12
[#68520] Possible regression in 2.1 and 2.2 in binding when combined with delegate? — Joe Swatosh <joe.swatosh@...>
# The following code
3 messages
2015/03/14
[#68604] GSOC project Cross-thread Fiber support — surya pratap singh raghuvanshi <oshosurya@...>
- *hi i am a third year computer science student interested in working
6 messages
2015/03/22
[#68606] Re: GSOC project Cross-thread Fiber support
— Tony Arcieri <bascule@...>
2015/03/22
Hi Surya,
[#68619] Re: GSOC project Cross-thread Fiber support
— surya pratap singh raghuvanshi <oshosurya@...>
2015/03/23
hi tony,
[ruby-core:68530] [Ruby trunk - Bug #10687] ArgumentError in certain cases of instance_exec (new bug in 2.2)
From:
hanachin@...
Date:
2015-03-15 13:18:05 UTC
List:
ruby-core #68530
Issue #10687 has been updated by Seiei Higa.
File relaxed.patch added
File test_lambda_relaxed.rb added
It seems broken at r48239
```console
$ ./ruby -v --disable-gems a.rb
ruby 2.2.0dev (2014-11-03 trunk 48238) [x86_64-darwin14]
["a", "b", "c", "d"]
```
```console
$ ./ruby -v --disable-gems a.rb
ruby 2.2.0dev (2014-11-03 trunk 48239) [x86_64-darwin14]
a.rb:1:in `block in <main>': wrong number of arguments (4 for 0..1) (ArgumentError)
from a.rb:4:in `instance_exec'
from a.rb:4:in `<main>'
```
I wrote a patch for fix this issue.
```diff
diff --git vm_args.c vm_args.c
index e4ade6b..cd52227 100644
--- vm_args.c
+++ vm_args.c
@@ -562,10 +562,14 @@ setup_parameters_complex(rb_thread_t * const th, const rb_iseq_t * const iseq, r
break;
case arg_setup_lambda:
if (given_argc == 1 &&
- given_argc != iseq->param.lead_num &&
+ given_argc != min_argc &&
+ (min_argc > 0 || iseq->param.flags.has_block) &&
!iseq->param.flags.has_rest &&
args_check_block_arg0(args, th, msl)) {
- given_argc = RARRAY_LENINT(args->rest);
+ int len = RARRAY_LENINT(args->rest);
+ if (len >= min_argc && len <= max_argc) {
+ given_argc = len;
+ }
}
}
```
And I wrote some test, passing a lambda as a block, then yield an array.
All test cases passed at r48238, But failed in trunk, and with this patch too.
----------------------------------------
Bug #10687: ArgumentError in certain cases of instance_exec (new bug in 2.2)
https://bugs.ruby-lang.org/issues/10687#change-51851
* Author: Anonymous
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport:
----------------------------------------
a.rb:
~~~
foo = ->(a = nil) do
p(a)
end
instance_exec(["a", "b", "c", "d"], &foo)
~~~
~~~
#=> rvm use 2.1 && ruby -v && ruby a.rb
Using /home/micaeked/.rvm/gems/ruby-2.1.5
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
["a", "b", "c", "d"]
#=> rvm use 2.2 && ruby -v && ruby a.rb
Using /home/micaeked/.rvm/gems/ruby-2.2.0
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
a.rb:1:in `block in <main>': wrong number of arguments (4 for 0..1) (ArgumentError)
from a.rb:5:in `instance_exec'
from a.rb:5:in `<main>'
~~~
---Files--------------------------------
relaxed.patch (654 Bytes)
test_lambda_relaxed.rb (10.6 KB)
--
https://bugs.ruby-lang.org/