Issue #3131 has been updated by Run Paint Run Run.

File kernel-hash.patch added

I believe the attached patch reflects the consensus between matz and Sura=
j. The only material difference is that a TypeError is raised instead of =
an ArgumentError for consistency with Integer(), Float(), etc.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3131

----------------------------------------
http://redmine.ruby-lang.org
ZGlmZiAtLWdpdCBhL29iamVjdC5jIGIvb2JqZWN0LmMKaW5kZXggMzRiOTUy
OS4uOWYzYmViYiAxMDA2NDQKLS0tIGEvb2JqZWN0LmMKKysrIGIvb2JqZWN0
LmMKQEAgLTIzODgsNiArMjM4OCwzOSBAQCByYl9mX2FycmF5KFZBTFVFIG9i
aiwgVkFMVUUgYXJnKQogICAgIHJldHVybiByYl9BcnJheShhcmcpOwogfQog
CitWQUxVRQorcmJfSGFzaChWQUxVRSB2YWwpCit7CisgICAgaWYgKE5JTF9Q
KHZhbCkpIHJldHVybiByYl9oYXNoX25ldygpOworICAgIFZBTFVFIHRtcCA9
IHJiX2NoZWNrX2hhc2hfdHlwZSh2YWwpOworICAgIGlmIChOSUxfUCh0bXAp
KSB7CisJaWYgKFRZUEUodmFsKSA9PSBUX0FSUkFZICYmIFJBUlJBWV9MRU4o
dmFsKSA9PSAwKSAKKwkgICAgcmV0dXJuIHJiX2hhc2hfbmV3KCk7CisJcmJf
cmFpc2UocmJfZVR5cGVFcnJvciwgImNhbid0IGNvbnZlcnQgJXMgaW50byBI
YXNoIiwgcmJfb2JqX2NsYXNzbmFtZSh2YWwpKTsKKyAgICB9CisgICAgcmV0
dXJuIHRtcDsKK30KKworLyoKKyAqICBjYWxsLXNlcToKKyAqICAgICBIYXNo
KGFyZykgICAgLT4gaGFzaAorICoKKyAqICBDb252ZXJ0cyA8aT5hcmc8L2k+
IHRvIGEgPGNvZGU+SGFzaDwvY29kZT4gYnkgY2FsbGluZworICogIDxpPmFy
ZzwvaT48Y29kZT4udG9faGFzaDwvY29kZT4uIFJldHVybnMgYW4gZW1wdHkg
PGNvZGU+SGFzaDwvY29kZ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