Skip to content

Commit 70a1b5f

Browse files
committed
Fixing a crash due to unguarded API call. rdar://22581469
1 parent e1de97e commit 70a1b5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/AST/ASTPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ void PrintAST::printAccessors(AbstractStorageDecl *ASD) {
900900
bool inProtocol = isa<ProtocolDecl>(ASD->getDeclContext());
901901
if (inProtocol ||
902902
(Options.AbstractAccessors && !Options.FunctionDefinitions)) {
903-
bool mutatingGetter = ASD->isGetterMutating();
903+
bool mutatingGetter = ASD->getGetter() && ASD->isGetterMutating();
904904
bool settable = ASD->isSettable(nullptr);
905905
bool nonmutatingSetter = false;
906906
if (settable && ASD->isSetterNonMutating() && ASD->isInstanceMember() &&

0 commit comments

Comments
 (0)