Skip to content

Commit 70213f0

Browse files
committed
[SILInliner] Handled null access storage base.
During inlining, lexical-ness of arguments is preserved. In the case of address arguments that come from alloc_stacks, the alloc_stacks are marked lexical. The base of the storage which is passed to the address is obtained via AccessStorageWithBase. In some circumstances, a base is not found. Handled that case by changing a dyn_cast of the base to a dyn_cast_or_null. rdar://99087653
1 parent 064b713 commit 70213f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ void SILInlineCloner::cloneInline(ArrayRef<SILValue> AppliedArgs) {
462462
continue;
463463

464464
auto storage = AccessStorageWithBase::compute(callArg);
465-
if (auto *asi = dyn_cast<AllocStackInst>(storage.base))
465+
if (auto *asi = dyn_cast_or_null<AllocStackInst>(storage.base))
466466
asi->setIsLexical();
467467
} else {
468468
// Insert begin/end borrow for guaranteed arguments.

0 commit comments

Comments
 (0)