Skip to content

Commit d90159a

Browse files
[LSP] Use std::string for storing the Reply method (#92464)
This was using a StringRef, which is very unsafe because the method name might just get disposed due to the async nature of the response. This was causing weird characters being printed in the output logs.
1 parent d38ea8c commit d90159a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/Tools/lsp-server-support/Transport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Reply {
4141
void operator()(llvm::Expected<llvm::json::Value> reply);
4242

4343
private:
44-
StringRef method;
44+
std::string method;
4545
std::atomic<bool> replied = {false};
4646
llvm::json::Value id;
4747
JSONTransport *transport;

0 commit comments

Comments
 (0)