aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-28 06:24:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-28 06:24:12 +0000
commitab0ed404a5b0fa4783b2010232d53f590ae5067d (patch)
tree731069832b17cffaafc9fdcdd394f1976c7ec576 /error.c
parent1d5160b390f2894482f89826d671a779384264dd (diff)
downloadruby-ab0ed404a5b0fa4783b2010232d53f590ae5067d.tar.gz
NameError#receiver of uninitialized constant
* error.c (name_err_mesg_to_str): quote the name if unprintable. * object.c (check_setter_id): use rb_check_id to convert names. * variable.c (uninitialized_constant): use NameError::message to keep the receiver of uninitialized constant. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/error.c b/error.c
index 7d533cc9a5..0a84937d78 100644
--- a/error.c
+++ b/error.c
@@ -1264,7 +1264,7 @@ name_err_mesg_to_str(VALUE obj)
else {
c = s = FAKE_CSTR(&s_str, "");
}
- args[0] = ptr[NAME_ERR_MESG__NAME];
+ args[0] = QUOTE(rb_obj_as_string(ptr[NAME_ERR_MESG__NAME]));
args[1] = d;
args[2] = s;
args[3] = c;