Skip to content

SR-5810: Fix slice data range calculation when inserting/deleting an element #1202

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

Closed
wants to merge 1 commit into from
Closed

SR-5810: Fix slice data range calculation when inserting/deleting an element #1202

wants to merge 1 commit into from

Conversation

sashabelonogov
Copy link
Contributor

@sashabelonogov sashabelonogov commented Sep 5, 2017

I recreated the bug described in the link below with 2 tests:
https://bugs.swift.org/browse/SR-5810

I found an issue in Data.init(backing: _DataStorage, range: Range) and, it seems like, successfully fixed it.
Please let me know if everything is done properly. Thanks

@parkera parkera requested a review from phausler September 5, 2017 23:07
@alblue
Copy link
Contributor

alblue commented Sep 6, 2017

@swift-ci please test

@alblue
Copy link
Contributor

alblue commented Sep 20, 2017

@phausler @parkera Since Swift 4.0 has now shipped, can we get this merged in and cherry-picked back to the swift-4 updates branch?

@alblue
Copy link
Contributor

alblue commented Sep 20, 2017

Or has swiftlang/swift#11939 rendered this unnecessary?

@ianpartridge
Copy link
Contributor

The fixes in swiftlang/swift#11939 need porting to this repo. Once that's done I suspect this PR will be obsolete although I'm not certain. @phausler would know for sure.

@phausler
Copy link
Contributor

Yea, but I will end up merging the tests once I have my patch up: hopefully later today

@sashabelonogov
Copy link
Contributor Author

Despite the fact that this PR is obsolete, did I do everything correctly? Is it ok to try to fix bugs from JIRA, assign them to me and send the PR or shouldn't I try this again?

@phausler
Copy link
Contributor

what you did was fine, there was just some underlying issues that were more pervasive than just the issue reported is all. I was working on the other side of it in the overlay and trying to hunt down a good solution for the more general failure.

@sashabelonogov
Copy link
Contributor Author

thanks @phausler!

@sashabelonogov sashabelonogov deleted the sashabelonogov/sr-5810 branch September 20, 2017 20:46
@phausler
Copy link
Contributor

btw I am still going to merge your test (with some modifications) since it is still valid

@sashabelonogov
Copy link
Contributor Author

Should I reopen the PR with the tests only?

@phausler
Copy link
Contributor

if you would like, the only alteration is that the starting indexes dont change after mutation now; it follows the same behavior as Array and ArraySlice indexing.

so in your first test the startIndex after mutation is 2 not 0 etc...

@sashabelonogov
Copy link
Contributor Author

Makes sense, I will make it now

@sashabelonogov
Copy link
Contributor Author

@phausler I updated the tests and created a new PR with tests only #1235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants