Fix for rdar://19614869, Fuzzing Swift: AnnotAndDiagASTConsumer crashes in SemaAnnotator::walkToDeclPost(...): Assertion failed: "lazy var not implicitly computed"

Minor: modified assertion to handle invalid getters.



Swift SVN r24896
This commit is contained in:
Denis Vnukov
2015-02-02 19:09:51 +00:00
parent 16bad7f7d3
commit 844fe7dd77
2 changed files with 9 additions and 1 deletions

View File

@@ -133,7 +133,8 @@ bool SemaAnnotator::walkToDeclPost(Decl *D) {
if (auto *VD = PBD->getSingleVar()) {
if (VD->getAttrs().hasAttribute<LazyAttr>()) {
if (auto *Get = VD->getGetter()) {
assert(Get->isImplicit() && "lazy var not implicitly computed");
assert((Get->isImplicit() || Get->isInvalid())
&& "lazy var getter must be either implicitly computed or invalid");
// Note that an implicit getter may not have the body synthesized
// in case the owning PatternBindingDecl is invalid.