Navigation Menu

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

[SR-5810] Mutating a Data slice mutates it in a "nuclear fallout" sort of way #3811

Closed
CharlesJS opened this issue Aug 31, 2017 · 5 comments
Closed

Comments

@CharlesJS
Copy link

Previous ID SR-5810
Radar rdar://problem/34198419
Original Reporter @CharlesJS
Type Bug
Status Resolved
Resolution Done
Environment

Swift version 4.1-dev (LLVM 4b4874ae4e, Clang c57d5b1d41, Swift 4264174392)
Target: x86_64-apple-darwin16.7.0

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee sashabelonogov (JIRA)
Priority Medium

md5: 09ac1fae4a36088c7c7a7c59395e05ec

Issue Description:

Suppose I have this function. It takes a Data object, makes a mutable copy, appends a byte to the beginning of the copy, and logs the result.

@belkadan
Copy link

belkadan commented Sep 1, 2017

Yikes. Thanks for tracking this down, Charles.

@swift-ci create

@CharlesJS
Copy link
Author

I hope my snark wasn't too obnoxious. ;-) I had a bit of fun writing this one.

@swift-ci
Copy link
Contributor

swift-ci commented Sep 5, 2017

Comment by Alexander Belonogov (JIRA)

I submitted a PR with a potential solution to this issue:

#1202

@CharlesJS
Copy link
Author

The bug still seems to occur with the Xcode 9 GM seed (9A235). Please tell me Xcode 9 isn't actually going to ship with this bug in it. :-/

@belkadan
Copy link

Fixed in apple/swift#11939 also cherry-picked to the swift-4.0-branch.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants