diff --git a/ChangeLog b/ChangeLog index 1e76fdaae8..19dd0984e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Sep 29 22:54:39 2014 Nobuyoshi Nakada + + * string.c (str_make_independent_expand): drop NOFREE flag after + reallocation, static buffer is not pointed anymore. + [ruby-core:65317] [Bug #10304] + Sun Sep 28 23:59:17 2014 Kazuki Tsujimoto * gc.c (rb_gcdebug_print_obj_condition): use RVALUE_REMEMBERED diff --git a/string.c b/string.c index d67d57dd64..fc6fe5942f 100644 --- a/string.c +++ b/string.c @@ -1577,7 +1577,7 @@ str_make_independent_expand(VALUE str, long expand) memcpy(ptr, RSTRING_PTR(str), len); } STR_SET_NOEMBED(str); - FL_UNSET(str, STR_SHARED); + FL_UNSET(str, STR_SHARED|STR_NOFREE); TERM_FILL(ptr + len, termlen); RSTRING(str)->as.heap.ptr = ptr; RSTRING(str)->as.heap.len = len;