diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | string.c | 4 | ||||
-rw-r--r-- | test/ruby/test_object.rb | 9 |
3 files changed, 1 insertions, 17 deletions
@@ -3,11 +3,6 @@ Fri Dec 4 11:22:40 2015 Nobuyoshi Nakada <[email protected]> * 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 <[email protected]> - - * 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 <[email protected]> * lib/scanf.rb: fixed double words typo. @@ -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 |