Skip to content

Commit 15c7bf8

Browse files
committed
[unittests] Fix a stack use-after-scope
We need to use a `std::function` here since it escapes the lifetime of the call. rdar://127362231
1 parent 19eb34c commit 15c7bf8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

unittests/SourceKit/SwiftLang/CloseTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ class CloseTest : public ::testing::Test {
111111

112112
void getDiagnosticsAsync(
113113
const char *DocName, ArrayRef<const char *> CArgs,
114-
llvm::function_ref<void(const RequestResult<DiagnosticsResult> &)>
115-
callback) {
114+
std::function<void(const RequestResult<DiagnosticsResult> &)> callback) {
116115
auto Args = makeArgs(DocName, CArgs);
117116
getLang().getDiagnostics(DocName, Args, /*VFSOpts*/ std::nullopt,
118117
/*CancelToken*/ {}, callback);

0 commit comments

Comments
 (0)