StringIO.set_encoding may change shared ByteList encoding #1699

merged 1 commit into from May 21, 2014


None yet

2 participants


When creating a StringIO instance with no arguments, ptr.string references the shared EMPTY_BYTELISTS instance for that encoding.

It is possible to then call set_encoding to change the encoding on the shared instance.

This fix is to duplicate the value before changing the encoding.

@enebo enebo merged commit 9228157 into jruby:master May 21, 2014

1 check failed

continuous-integration/travis-ci The Travis CI build failed
@enebo enebo added this to the JRuby 1.7.13 milestone May 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment