Skip to content

Commit 0c5b245

Browse files
committed
Merge pull request #2974 from benlangmuir/return-range
2 parents 4aa3f9c + f33f531 commit 0c5b245

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/AST/Stmt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ SourceLoc ReturnStmt::getStartLoc() const {
153153
return ReturnLoc;
154154
}
155155
SourceLoc ReturnStmt::getEndLoc() const {
156-
return (Result ? Result->getEndLoc() : ReturnLoc);
156+
if (Result && Result->getEndLoc().isValid())
157+
return Result->getEndLoc();
158+
return ReturnLoc;
157159
}
158160

159161
SourceLoc ThrowStmt::getEndLoc() const { return SubExpr->getEndLoc(); }

0 commit comments

Comments
 (0)