Issue #11767 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE

ruby_2_1 r52875 merged revision(s) 52868.

----------------------------------------
Bug #11767: Range#to_s and Range#inspect are not infected by the receiver
https://bugs.ruby-lang.org/issues/11767#change-55227

* Author: Nobuyoshi Nakada
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: r52866
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
----------------------------------------
In general, `to_s` and `inspect` on a tainted object should result a tainted string.
`Range` seems the only exception.

## code
~~~ruby
p ("0".taint.."1").to_s.tainted?
p ("0".."1".taint).to_s.tainted?
p ("0".."1").taint.to_s.tainted?
~~~

## expected result
prints `true` 3 times.

## actual result
prints `true`, `true`, and `false`.




-- 
https://bugs.ruby-lang.org/