diff --git a/string.c b/string.c index 6482e32c51..4e402d9116 100644 --- a/string.c +++ b/string.c @@ -689,7 +689,7 @@ rb_str_resize(VALUE str, long len) return str; } ptr = ALLOC_N(char,len+1); - MEMCPY(ptr, RSTRING(str)->ary, char, RSTRING_LEN(str)); + MEMCPY(ptr, RSTRING_PTR(str), char, RSTRING_LEN(str)); RSTRING(str)->as.heap.ptr = ptr; STR_SET_NOEMBED(str); }