Skip to content

SILGen: Don't crash on withoutActuallyEscaping of objc blocks #15393

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

Conversation

aschwaighofer
Copy link
Contributor

rdar://38689227

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test and merge

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

Also, maybe refactor this function after you get in the fix? It seems like it has subroutines within it.

SILFunctionTypeRepresentation::Thick) {
RValue rvalue;
auto escapingClosure =
SGF.emitManagedRValueWithCleanup(SGF.B.createConvertFunction(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use SILGenFunction APIs instead of doing this by hand here?

opaqueValue);

// Emit the guarded expression.
rvalue = visit(E->getSubExpr(), C);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just return this rather than assign to rvalue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will cleanup in follow-up commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

SGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Do we have executable tests for withoutActuallyEscaping? Might want to add one with a block also.

@swift-ci swift-ci merged commit 478a195 into swiftlang:master Mar 21, 2018
@aschwaighofer
Copy link
Contributor Author

@slavapestov Yes there is test/Interpreter/withoutActuallyEscaping.swift

@aschwaighofer
Copy link
Contributor Author

Executable test: #15406

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