summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-17 02:50:37 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-17 02:50:37 +0000
commitd4f507ab97bb039ca5e7b9fcfc1adddfa5e9efaf (patch)
treeddac47734f604be140b8d566f47915b7a0eaa344 /string.c
parent4aacaf216c64be1c45983aa992c8f4f9160ba6c7 (diff)
merge revision(s) 49586: [Backport #10853]
* string.c (str_discard): does not free for STR_NOFREE string. [Bug #10853][ruby-core:68110] * bootstraptest/test_string.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 9053835ee2..0fae07d938 100644
--- a/string.c
+++ b/string.c
@@ -1658,7 +1658,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;