aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--string.c4
-rw-r--r--test/ruby/test_object.rb9
3 files changed, 1 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 8bd8180088..f27faf9c3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,11 +3,6 @@ Fri Dec 4 11:22:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread.c (rb_thread_setname): name must be ascii-compatible, as
pthread APIs do not accept legacy wide char strings.
-Thu Dec 3 16:02:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_obj_as_string): fstring should not be infected.
- TODO: other frozen strings also may not be.
-
Thu Dec 3 15:39:21 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* lib/scanf.rb: fixed double words typo.
diff --git a/string.c b/string.c
index 4cb62375da..d1a051b6dd 100644
--- a/string.c
+++ b/string.c
@@ -1247,9 +1247,7 @@ rb_obj_as_string(VALUE obj)
str = rb_funcall(obj, idTo_s, 0);
if (!RB_TYPE_P(str, T_STRING))
return rb_any_to_s(obj);
- if (!FL_SET(str, RSTRING_FSTR) && FL_ABLE(obj))
- /* fstring must not be tainted, at least */
- OBJ_INFECT_RAW(str, obj);
+ OBJ_INFECT(str, obj);
return str;
}
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index 27f3bd18ce..a3c71d605c 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -755,15 +755,6 @@ class TestObject < Test::Unit::TestCase
end
EOS
assert_match(/\bToS\u{3042}:/, x)
-
- name = "X".freeze
- x = Object.new.taint
- class<<x;self;end.class_eval {define_method(:to_s) {name}}
- assert_same(name, x.to_s)
- assert_not_predicate(name, :tainted?)
- assert_raise(RuntimeError) {name.taint}
- assert_equal("X", [x].join(""))
- assert_not_predicate(name, :tainted?)
end
def test_inspect