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
SR-5557: Fix NSRegularExpression errors with invalid pattern #1164
Conversation
I probably haven't had enough coffee but I don't quite follow this one... Why does it make a difference whether it's an array of |
When I don't think the I think we will need either @parkera or @phausler to validate this fix. |
- The error dictionary in CFRegularExpression was failing with the error key being a CFSTR inside an array so initialiase it outside of the array.
Yes you're right. I imagine this code is unchanged from Darwin so maybe there's some other factors involved. |
Yes, although it did actually crash corelibs-foundation on macOS as well, which makes even less sense! |
The problem previously with the key was because CFSTR in swift-corelibs does not use the builtin but instead uses an inline address of. That hack won't work with c arrays. Overall this change looks reasonable to me. |
Thats good to know. I did a quick audit of CSTR in CoreFoundation and noticed a few places where it is used in arrays so I'll add a PR soon to fix those cases |
@swift-ci please test and merge |
@ianpartridge This looks to have failed due to an unrelated swift test failing, can you retry? |
@swift-ci please test and merge |
error key being a CFSTR inside an array so initialiase it outside
of the array.
I removed the
_nsObject
as I think throwing the error dictionary is more useful as it gave a better error message when stringified.Should a description be added to the error dictionary to eliminate the '(null)'?