Skip to content

Commit 03d3887

Browse files
committed
[Async Refactoring] Convert data structure storing continuation resume args to std::vector
The `std::vector` keeps its elements alive. Currently, we might be accessing uninitalized memory if the call of `callArgs(CE)` (which owns its elements in case there is a single element) goes out of scope before `Args`.
1 parent c3e9676 commit 03d3887

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/IDE/Refactoring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6634,7 +6634,7 @@ class AsyncConverter : private SourceEntityWalker {
66346634
"TopHandler's completion handler");
66356635
assert(Scopes.back().isWrappedInContination());
66366636

6637-
ArrayRef<Expr *> Args;
6637+
std::vector<Expr *> Args;
66386638
StringRef ResumeArgumentLabel;
66396639
switch (TopHandler.getHandlerType()) {
66406640
case HandlerType::PARAMS: {

0 commit comments

Comments
 (0)