Skip to content

Commit 46d2245

Browse files
committed
ASTScope: Assert that we don't re-expand
1 parent 048b335 commit 46d2245

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/ASTScopeCreation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,9 @@ ExpandASTScopeRequest::evaluate(Evaluator &evaluator, ASTScopeImpl *parent,
938938
}
939939

940940
ASTScopeImpl *ASTScopeImpl::expandAndBeCurrent(ScopeCreator &scopeCreator) {
941+
ASTScopeAssert(!getWasExpanded(),
942+
"Cannot expand the same scope twice");
943+
941944
auto *insertionPoint = expandSpecifically(scopeCreator);
942945
ASTScopeAssert(!insertionPointForDeferredExpansion() ||
943946
insertionPointForDeferredExpansion().get() ==

0 commit comments

Comments
 (0)