Skip to content

Commit 132eb93

Browse files
committed
[silgen] Fix a small typo bug I found on inspection.
We are performing a cast instead of a dyn_cast in an if statement. This will assert on failure rather than fall through. It seems to be an obvious typo. I checked in the actual commit in question that introduced it and the intention was to be a dyn_cast. rdar://149698148
1 parent e55c9bf commit 132eb93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILGen/ResultPlan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class IndirectOpenedSelfCleanup final : public Cleanup {
8181
assert(box && "buffer never emitted before activating cleanup?!");
8282
auto theBox = box;
8383
if (SGF.getASTContext().SILOpts.supportsLexicalLifetimes(SGF.getModule())) {
84-
if (auto *bbi = cast<BeginBorrowInst>(theBox)) {
84+
if (auto *bbi = dyn_cast<BeginBorrowInst>(theBox)) {
8585
SGF.B.createEndBorrow(loc, bbi);
8686
theBox = bbi->getOperand();
8787
}

0 commit comments

Comments
 (0)