Fix a crash on subscript decls in protocols.

Swift SVN r12277
This commit is contained in:
Chris Lattner
2014-01-14 04:33:45 +00:00
parent b0b5a8f774
commit 5c23e3568c

View File

@@ -1526,7 +1526,9 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
// Subscripts are ok on rvalues so long as the getter is @!mutating.
if (auto *SD = dyn_cast<SubscriptDecl>(result))
if (SD->getGetter()->isMutating())
// The subscript decl won't have a getter if this is in protocol. In
// that case, we assume it is non-mutating.
if (SD->getGetter() && SD->getGetter()->isMutating())
continue;
// Computed properties are ok on rvalues so long as the getter is