Skip to content

[swift-3.0-branch] Fix crash in NSValue.isEqual() when it is passed an NSNumber #634

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

Conversation

moiseev
Copy link
Contributor

@moiseev moiseev commented Sep 13, 2016

  • Explanation: Fixing the crash in NSValue.isEqual
  • Scope of Issue: NSValue.isEqual was not handling the case where the underlying value was an NSNumber
  • Origination: Existing bug in the code
  • Risk: Minimal
  • Reviewed By: Dmitri Gribenko
  • Testing: Ran the existing test suite.
  • Directions for QA: N/A

rdar://problem/28284641

…ng#619)

NSNumbers are not added to the side table, so we can't find them.
@moiseev
Copy link
Contributor Author

moiseev commented Sep 13, 2016

@swift-ci Please test
@phausler this is the change you approved in #619

@parkera
Copy link
Contributor

parkera commented Sep 13, 2016

@swift-ci please test

@tkremenek
Copy link
Member

This is up to @parkera to approve.

@moiseev
Copy link
Contributor Author

moiseev commented Sep 15, 2016

Even though swiftlang/swift#4753 does not get pulled in the release, I believe this PR qualifies as a bug fix, so is still worth merging.
@parkera, what do you think?

var long: Int32 = 123456
let value = NSValue(bytes: &long, objCType: "l")
XCTAssertFalse(value.isEqual(number))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a positive-sense test here as well?

@moiseev
Copy link
Contributor Author

moiseev commented Sep 20, 2016

Not going to merge. See explanation here.

@moiseev moiseev closed this Sep 20, 2016
@moiseev moiseev deleted the isequal-ccc branch September 20, 2016 00:24
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