-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
SILGen: Don't crash on withoutActuallyEscaping of objc blocks #15393
Conversation
rdar://38689227
rdar://38689227
@swift-ci Please test and merge |
There was a problem hiding this 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( |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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.
@slavapestov Yes there is test/Interpreter/withoutActuallyEscaping.swift |
Executable test: #15406 |
rdar://38689227