Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringIO.set_encoding may change shared ByteList encoding #1699

Merged
merged 1 commit into from May 21, 2014

Conversation

Projects
None yet
2 participants
@orikremer
Copy link
Contributor

orikremer commented May 15, 2014

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 added a commit that referenced this pull request May 21, 2014

Merge pull request #1699 from intentmedia/stringio_modify_before_set_…
…encoding

StringIO.set_encoding may change shared ByteList encoding

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

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details

@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
You can’t perform that action at this time.