summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/error.c b/error.c
index ca563722ba..b89818337e 100644
--- a/error.c
+++ b/error.c
@@ -356,7 +356,8 @@ rb_check_type(VALUE x, int t)
etype = "Symbol";
}
else if (rb_special_const_p(x)) {
- etype = RSTRING_PTR(rb_obj_as_string(x));
+ x = rb_obj_as_string(x);
+ etype = StringValuePtr(x);
}
else {
etype = rb_obj_classname(x);