diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | bootstraptest/test_string.rb | 3 | ||||
-rw-r--r-- | string.c | 2 |
3 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Fri Feb 13 21:52:05 2015 Yusuke Endoh <[email protected]> + + * string.c (str_discard): does not free for STR_NOFREE string. + [Bug #10853][ruby-core:68110] + + * bootstraptest/test_string.rb: test for above. + Fri Feb 13 21:16:00 2015 Yusuke Endoh <[email protected]> * lib/base64.rb: make urlsafe mode user-friendly. diff --git a/bootstraptest/test_string.rb b/bootstraptest/test_string.rb new file mode 100644 index 0000000000..849dcd45b0 --- /dev/null +++ b/bootstraptest/test_string.rb @@ -0,0 +1,3 @@ +assert_normal_exit %q{ + inspect.clear +}, '[ruby-core:68110]' @@ -1662,7 +1662,7 @@ static inline void str_discard(VALUE str) { str_modifiable(str); - if (!STR_SHARED_P(str) && !STR_EMBED_P(str)) { + if (!STR_EMBED_P(str) && !FL_TEST(str, STR_SHARED|STR_NOFREE)) { ruby_sized_xfree(STR_HEAP_PTR(str), STR_HEAP_SIZE(str)); RSTRING(str)->as.heap.ptr = 0; RSTRING(str)->as.heap.len = 0; |