summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hash.c1
-rw-r--r--test/ruby/test_hash.rb2
2 files changed, 3 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 7e18a40..53d70f9 100644
--- a/hash.c
+++ b/hash.c
@@ -1119,6 +1119,7 @@ rb_hash_reject(VALUE hash)
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
ret = hash_alloc(rb_obj_class(hash));
+ OBJ_INFECT(ret, hash);
if (!RHASH_EMPTY_P(hash)) {
rb_hash_foreach(hash, reject_i, ret);
}
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 4244b86..0593785 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -555,6 +555,8 @@ class TestHash < Test::Unit::TestCase
assert_equal(h3, h.reject {|k,v| v })
assert_equal(base, h)
+
+ assert_predicate(h.taint.reject {true}, :tainted?)
end
def test_reject!