Skip to content

Conversation

@spevans
Copy link
Contributor

@spevans spevans commented Aug 26, 2018

  • CFHash() doesnt see objects of type NSMutableData as CF objects
    so calls back to NSObject.hash which causes infinite recursion.

  • Directly call _CFNonObjCHash() to bypass this check.

- CFHash() doesnt see objects of type NSMutableData as CF objects
  so calls back to NSObject.hash which causes infinite recursion.

- Directly call _CFNonObjCHash() to bypass this check.
@spevans
Copy link
Contributor Author

spevans commented Aug 26, 2018

@swift-ci please test

@parkera
Copy link
Contributor

parkera commented Aug 27, 2018

Yikes. This would be good for the 4.2 branch.

@parkera parkera self-requested a review August 27, 2018 16:12
@parkera parkera merged commit e65848b into swiftlang:master Aug 27, 2018
@spevans
Copy link
Contributor Author

spevans commented Aug 27, 2018

@parkera Would this affect other classes? Should _CFNonObjCHash be used instead of CFHash for all implementations of hash() in the NS* classes?

@parkera
Copy link
Contributor

parkera commented Aug 27, 2018

That is reasonable. It looks like most of our Darwin ObjC implementations simply implement their own hash instead of using the CFHash function in the first place.

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.

2 participants