1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* variable.c (rb_define_hooked_variable): guard *var from GC to

prevent collecting argf under RUBY_DEBUG=gc_stress.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-05-02 14:57:23 +00:00
parent f099a94afa
commit 3a0a3f4ea2
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Fri May 2 23:55:15 2008 Tanaka Akira <akr@fsij.org>
* variable.c (rb_define_hooked_variable): guard *var from GC to
prevent collecting argf under RUBY_DEBUG=gc_stress.
Fri May 2 17:29:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* range.c (range_step): call to_int if step is not a numeric

View file

@ -455,13 +455,20 @@ rb_define_hooked_variable(
void (*setter)(ANYARGS))
{
struct global_variable *gvar;
ID id = global_id(name);
ID id;
VALUE tmp;
if (var)
tmp = *var;
id = global_id(name);
gvar = rb_global_entry(id)->var;
gvar->data = (void*)var;
gvar->getter = getter?getter:var_getter;
gvar->setter = setter?setter:var_setter;
gvar->marker = var_marker;
RB_GC_GUARD(tmp);
}
void