summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index 81b9b9d134..c477e950a6 100644
--- a/string.c
+++ b/string.c
@@ -1349,7 +1349,8 @@ rb_string_value(volatile VALUE *ptr)
{
VALUE s = *ptr;
if (TYPE(s) != T_STRING) {
- *ptr = rb_str_to_str(s);
+ s = rb_str_to_str(s);
+ *ptr = s;
}
return s;
}