summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 14:57:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 14:57:04 +0000
commit24cf72029f0c43f59520b88d1eafee4959bcddc1 (patch)
tree5a95f9566d6389ff96fa1e8cb283fcb64ec7de67 /vm_method.c
parent372eb2cbfed1b7f5d7e2af1ced551ab4087c95a5 (diff)
object.c: avoid inadvertent symbol creation
* object.c (id_for_attr): avoid inadvertent symbol creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/vm_method.c b/vm_method.c
index 584982d51d..0066c17c8a 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -809,6 +809,8 @@ rb_method_boundp(VALUE klass, ID id, int ex)
return 0;
}
+extern ID rb_check_attr_id(ID id);
+
void
rb_attr(VALUE klass, ID id, int read, int write, int ex)
{
@@ -834,10 +836,7 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex)
}
}
- if (!rb_is_local_id(id) && !rb_is_const_id(id)) {
- rb_name_error_str(id, "invalid attribute name `%"PRIsVALUE"'", QUOTE_ID(id));
- }
- aname = rb_id2str(id);
+ aname = rb_id2str(rb_check_attr_id(id));
if (NIL_P(aname)) {
rb_raise(rb_eArgError, "argument needs to be symbol or string");
}