[Mlir-commits] [mlir] d90159a - [LSP] Use std::string for storing the Reply method (#92464)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri May 17 09:33:04 PDT 2024


Author: Walter Erquinigo
Date: 2024-05-17T12:32:59-04:00
New Revision: d90159add4140d6f4994f5767fa6ef31cc28897b

URL: https://github.com/llvm/llvm-project/commit/d90159add4140d6f4994f5767fa6ef31cc28897b
DIFF: https://github.com/llvm/llvm-project/commit/d90159add4140d6f4994f5767fa6ef31cc28897b.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Tools/lsp-server-support/Transport.cpp b/mlir/lib/Tools/lsp-server-support/Transport.cpp
index 1e90ab32281f5..ca7ffdf78d3a1 100644
--- a/mlir/lib/Tools/lsp-server-support/Transport.cpp
+++ b/mlir/lib/Tools/lsp-server-support/Transport.cpp
@@ -41,7 +41,7 @@ class Reply {
   void operator()(llvm::Expected<llvm::json::Value> reply);
 
 private:
-  StringRef method;
+  std::string method;
   std::atomic<bool> replied = {false};
   llvm::json::Value id;
   JSONTransport *transport;


        


More information about the Mlir-commits mailing list