* error.c (rb_name_err_mesg_new): guard mesg, recv and method.

The problem in [ruby-dev:41464] is caused because mesg is collected.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-06-05 02:01:29 +00:00
parent 8bca09325d
commit d81b2491f7
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sat Jun 5 11:00:48 2010 Tanaka Akira <akr@fsij.org>
* error.c (rb_name_err_mesg_new): guard mesg, recv and method.
The problem in [ruby-dev:41464] is caused because mesg is collected.
Sat Jun 5 10:03:31 2010 Tanaka Akira <akr@fsij.org>
* .gdbinit (rp): detect and show RTypedData.

View File

@ -825,11 +825,16 @@ VALUE
rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method)
{
VALUE *ptr = ALLOC_N(VALUE, NAME_ERR_MESG_COUNT);
VALUE result;
ptr[0] = mesg;
ptr[1] = recv;
ptr[2] = method;
return TypedData_Wrap_Struct(rb_cNameErrorMesg, &name_err_mesg_data_type, ptr);
result = TypedData_Wrap_Struct(rb_cNameErrorMesg, &name_err_mesg_data_type, ptr);
RB_GC_GUARD(mesg);
RB_GC_GUARD(recv);
RB_GC_GUARD(method);
return result;
}
/* :nodoc: */