Skip to content

[PrintAsObjC] Don't use take an ArrayRef into temporary storage. #9065

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

Merged

Conversation

DougGregor
Copy link
Member

ObjCSelector::getSelectorPieces() can return a pointer to *this, so
don't use it on a temporary. Fixes an ASan-detected
stack-use-after-scope, rdar://problem/31837593.

ObjCSelector::getSelectorPieces() can return a pointer to *this, so
don't use it on a temporary. Fixes an ASan-detected
stack-use-after-scope, rdar://problem/31837593.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 2680087 into swiftlang:master Apr 27, 2017
@DougGregor DougGregor deleted the printasobjc-stack-use-after-scope branch April 27, 2017 06:23
@jrose-apple
Copy link
Contributor

:-( Any way we can fix this? Would marking getSelectorPieces as & be the right condition, or do we still care about the immediately-use-as-argument case?

@DougGregor
Copy link
Member Author

Marking getSelectorPieces as & would help flush out any remaining issues. I doubt it's used often enough that it would uglify much code.

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.

3 participants