mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
merge revision(s) 45576: [Backport #11572]
* string.c (sym_to_proc), proc.c (rb_block_clear_env_self): clear caller's self which is useless, so that it can get collected. [Fixes GH-592] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@52362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
24d44aeb02
commit
a6b6f9bb59
5 changed files with 20 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Oct 29 23:54:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (sym_to_proc), proc.c (rb_block_clear_env_self): clear
|
||||
caller's self which is useless, so that it can get collected.
|
||||
[Fixes GH-592]
|
||||
|
||||
Thu Oct 29 23:30:20 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||
|
||||
* lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address contained
|
||||
|
|
|
@ -630,6 +630,7 @@ void rb_gc_mark_symbols(int full_mark);
|
|||
VALUE rb_proc_location(VALUE self);
|
||||
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
|
||||
int rb_block_arity(void);
|
||||
VALUE rb_block_clear_env_self(VALUE proc);
|
||||
|
||||
/* process.c */
|
||||
#define RB_MAX_GROUPS (65536)
|
||||
|
|
11
proc.c
11
proc.c
|
@ -636,6 +636,17 @@ rb_block_lambda(void)
|
|||
return proc_new(rb_cProc, TRUE);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_block_clear_env_self(VALUE proc)
|
||||
{
|
||||
rb_proc_t *po;
|
||||
rb_env_t *env;
|
||||
GetProcPtr(proc, po);
|
||||
GetEnvPtr(po->envval, env);
|
||||
env->env[0] = Qnil;
|
||||
return proc;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_f_lambda(void)
|
||||
{
|
||||
|
|
1
string.c
1
string.c
|
@ -8540,6 +8540,7 @@ sym_to_proc(VALUE sym)
|
|||
}
|
||||
else {
|
||||
proc = rb_proc_new(sym_call, (VALUE)id);
|
||||
rb_block_clear_env_self(proc);
|
||||
aryp[index] = sym;
|
||||
aryp[index + 1] = proc;
|
||||
return proc;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.1.8"
|
||||
#define RUBY_RELEASE_DATE "2015-10-29"
|
||||
#define RUBY_PATCHLEVEL 411
|
||||
#define RUBY_PATCHLEVEL 412
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2015
|
||||
#define RUBY_RELEASE_MONTH 10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue