Skip to content

Commit 8923391

Browse files
committed
enforce expectations with an assert in deferExecutorBreadcrumb
I do not expect anyone to defer multiple breadcrumbs in a single result plan.
1 parent 273a550 commit 8923391

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SILGen/ResultPlan.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,9 @@ class ForeignAsyncInitializationPlan final : public ResultPlan {
598598
return ManagedValue::forUnmanaged(block);
599599
}
600600

601-
void deferExecutorBreadcrumb(ExecutorBreadcrumb &&breadcrumb) override {
602-
this->breadcrumb = breadcrumb;
601+
void deferExecutorBreadcrumb(ExecutorBreadcrumb &&crumb) override {
602+
assert(!breadcrumb.needsEmit() && "overwriting an existing breadcrumb?");
603+
breadcrumb = std::move(crumb);
603604
}
604605

605606
RValue finish(SILGenFunction &SGF, SILLocation loc, CanType substType,

0 commit comments

Comments
 (0)