Skip to content

[QoI] Cleanup AST after trying to shrink constraint system of invalid expression #6801

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
merged 1 commit into from
Jan 14, 2017

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jan 14, 2017

Since ConstraintSystem::shrink is going to attempt to type-check
sub-expressions separately it's essential to clean-up AST if constraint
generation or solving of the such expressions fails, otherwise if
such solving resulted in creation of implicit expression type variables
might leak to the outside.

… expression

Since `ConstraintSystem::shrink` is going to attempt to type-check
sub-expressions separately it's essential to clean-up AST if constraint
generation or solving of the such expressions fails, otherwise if
such solving resulted in creation of implicit expression type variables
might leak to the outside.
@xedin
Copy link
Contributor Author

xedin commented Jan 14, 2017

/cc @rudkx @slavapestov

Second attempt which should make ASAN happy, the problem with original solution was that I overlooked that CleanupIllFormedExpressionRAII expected 'reference to pointer' for the expression it has to clean up afterwards...

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 914356f into swiftlang:master Jan 14, 2017
@xedin
Copy link
Contributor Author

xedin commented Jan 14, 2017

Thanks, @slavapestov!

@gparker42
Copy link
Contributor

ASAN doesn't like this version either. Please fix or revert. (Github revert isn't working.)

@xedin
Copy link
Contributor Author

xedin commented Jan 14, 2017

@slavapestov Any ideas why that might be happening? Another approach might be to use a function and just call it directly in two places where it returns true...

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