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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sema] Skip UNCHECKED_EXPRs in ErrorHandlingWalker #5751

Merged
merged 1 commit into from Nov 14, 2016

Conversation

jtbandes
Copy link
Collaborator

On rare occasions, malformed programs can allow an UNCHECKED_EXPR (e.g. ArrowExpr) to escape type checking. The erroneous expression may have sub-expressions which aren't fully typechecked, so we can't safely visit them.

Resolves at least 1 compiler crasher. CI will tell me if there are any others. 馃槂

@jtbandes
Copy link
Collaborator Author

@swift-ci please test

#define UNCHECKED_EXPR(KIND, BASE) \
else if (isa<KIND##Expr>(E)) return {false, nullptr};
#include "swift/AST/ExprNodes.def"
#undef UNCHECKED_EXPR
Copy link
Contributor

Choose a reason for hiding this comment

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

The #undef isn't needed as ExprNodes.def #undefs everything in the end

On rare occasions, malformed programs can allow an UNCHECKED_EXPR (e.g. ArrowExpr) to escape type checking. The erroneous expression may have sub-expressions which aren't fully typechecked, so we can't safely visit them.
@jtbandes
Copy link
Collaborator Author

@swift-ci please smoke test

@CodaFi
Copy link
Member

CodaFi commented Nov 13, 2016

Timeout isn't your fault.

@swift-ci please smoke test Linux platform.

@jtbandes
Copy link
Collaborator Author

@swift-ci please smoke test Linux

@slavapestov slavapestov merged commit 783012f into apple:master Nov 14, 2016
@jtbandes jtbandes deleted the validation-ignore-unchecked branch November 14, 2016 20:51
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.

None yet

5 participants