-
Notifications
You must be signed in to change notification settings - Fork 188
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
Fix an issue where Regexp.union
was improperly negotiating the result encoding
#3296
Conversation
…lt encoding. As part of this fix we were able to remove the non-standard `Regexp.convert`. Co-authored-by: Simon LeVasseur <[email protected]>
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
res = enc | ||
else | ||
res = Primitive.encoding_compatible?(enc, res) | ||
raise ArgumentError, "incompatible encodings: #{enc} and #{res}" unless res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res
in the exception message will always be nil
here, we need to save the value in a local variable. I'll do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks. I had originally written it using reduce
and missed this when I restructured the code.
Thank you for signing the OCA. |
As part of this fix we were able to remove the non-standard
Regexp.convert
.Looking at this code, there's a lot more we could do to make it compilation friendly. I think we could implement
QuoteNode
without delegating toClassicRegexp.quote19
, but I'm going to save that for future work in the interest of getting #3287 fixed./cc @simonlevasseur
Fixes #3287