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

[Xcode 9 beta 5] Fixed an issue causing infinite recursion in the Swift runtime. #3498

Merged
merged 3 commits into from Aug 16, 2017

Conversation

andersio
Copy link
Member

@andersio andersio commented Aug 9, 2017

Checklist

  • Updated CHANGELOG.md.

@andersio andersio added the bug label Aug 9, 2017
@andersio andersio force-pushed the fix-swift-runtime-infinite-recursion branch from 4bd07f4 to fa18d14 Compare August 9, 2017 16:50
@andersio andersio changed the title Fixed an issue causing infinite recursion in the Swift runtime. [Xcode 9 beta 5]Fixed an issue causing infinite recursion in the Swift runtime. Aug 9, 2017
@andersio andersio changed the title [Xcode 9 beta 5]Fixed an issue causing infinite recursion in the Swift runtime. [Xcode 9 beta 5] Fixed an issue causing infinite recursion in the Swift runtime. Aug 9, 2017
@@ -110,7 +110,7 @@ private func subclassName(of class: AnyClass) -> String {
/// - class: The class to swizzle.
/// - perceivedClass: The class to be reported by the methods.
private func replaceGetClass(in class: AnyClass, decoy perceivedClass: AnyClass) {
let getClass: @convention(block) (Any) -> AnyClass = { _ in
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this cause infinite recursion? 😕

Copy link
Member Author

@andersio andersio Aug 9, 2017

Choose a reason for hiding this comment

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

The stack is overflown by an infinite recursion of Swift._bridgeAnyObjectToAny. We shouldn't have used Any here anyway.

Copy link
Member Author

@andersio andersio Aug 9, 2017

Choose a reason for hiding this comment

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

screen shot 2017-08-10 at 1 54 52 am

Presumably since beta 5 the bridging call relies on -class and +class, which in turns require bridging due to the use of Any.

@mdiep mdiep mentioned this pull request Aug 11, 2017
@liscio
Copy link
Contributor

liscio commented Aug 15, 2017

This one bit me pretty badly recently during development. Any idea what is causing the CI build to fail? I know nothing about CocoaPods, myself…

@ikesyo
Copy link
Member

ikesyo commented Aug 15, 2017

@liscio @andersio

$ pod lib lint ReactiveCocoa.podspec
 -> ReactiveCocoa (6.0.0)
    - WARN  | swift_version: The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: 
    `echo "2.3" > .swift-version`
[!] ReactiveCocoa did not pass validation, due to 1 warning (but you can use `--allow-warnings` to ignore it).
You can use the `--no-clean` option to inspect any issue.
The command "pod lib lint ReactiveCocoa.podspec" exited with 1.

We should pass --swift-version=3.0 to pod lib lint ReactiveCocoa.podspec to silence the warning (or --allow-warnings).

@andersio andersio merged commit 4e57bc5 into master Aug 16, 2017
@andersio andersio deleted the fix-swift-runtime-infinite-recursion branch August 16, 2017 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants