diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-05 02:01:29 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-05 02:01:29 +0000 |
commit | d81b2491f7e59ae0fcd8d006736c4b41bb27d990 (patch) | |
tree | 0a45680c2a41470c6a7485f085cb6086d7870b3b /error.c | |
parent | 8bca09325d9ce89fe32c0e6356865fcc905c7a2c (diff) | |
download | ruby-d81b2491f7e59ae0fcd8d006736c4b41bb27d990.tar.gz |
* 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
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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: */ |