summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-31 04:30:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-31 04:30:28 +0000
commitbdbda951d104ed4b1576458e943ed3c52bb2dfa9 (patch)
treeb7cc33bc02d487cf85e1dfae83697b8f65babfe3 /proc.c
parent378161fe68f283599ce91cda3aaa3658af7c6e89 (diff)
proc.c: local variable
* proc.c (umethod_bind): extract a local variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/proc.c b/proc.c
index e45d30bd8e..dd1250d839 100644
--- a/proc.c
+++ b/proc.c
@@ -1918,18 +1918,20 @@ static VALUE
umethod_bind(VALUE method, VALUE recv)
{
struct METHOD *data, *bound;
+ VALUE methclass;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- if (!RB_TYPE_P(data->rclass, T_MODULE) &&
- data->rclass != CLASS_OF(recv) && !rb_obj_is_kind_of(recv, data->rclass)) {
- if (FL_TEST(data->rclass, FL_SINGLETON)) {
+ methclass = data->rclass;
+ if (!RB_TYPE_P(methclass, T_MODULE) &&
+ methclass != CLASS_OF(recv) && !rb_obj_is_kind_of(recv, methclass)) {
+ if (FL_TEST(methclass, FL_SINGLETON)) {
rb_raise(rb_eTypeError,
"singleton method called for a different object");
}
else {
rb_raise(rb_eTypeError, "bind argument must be an instance of %s",
- rb_class2name(data->rclass));
+ rb_class2name(methclass));
}
}