[Lldb-commits] [PATCH] D59400: [lldb-vscode] Fix dangling pointer in request_evaluate.

Jorge Gorbe Moya via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 14 18:46:15 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB356227: [lldb-vscode] Fix dangling pointer in request_evaluate. (authored by jgorbe, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59400?vs=190764&id=190769#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59400/new/

https://reviews.llvm.org/D59400

Files:
  tools/lldb-vscode/lldb-vscode.cpp


Index: tools/lldb-vscode/lldb-vscode.cpp
===================================================================
--- tools/lldb-vscode/lldb-vscode.cpp
+++ tools/lldb-vscode/lldb-vscode.cpp
@@ -965,7 +965,10 @@
       value = frame.EvaluateExpression(expression.data());
     if (value.GetError().Fail()) {
       response["success"] = llvm::json::Value(false);
-      const char *error_cstr = value.GetError().GetCString();
+      // This error object must live until we're done with the pointer returned
+      // by GetCString().
+      lldb::SBError error = value.GetError();
+      const char *error_cstr = error.GetCString();
       if (error_cstr && error_cstr[0])
         EmplaceSafeString(response, "message", std::string(error_cstr));
       else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59400.190769.patch
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190315/8161b1fa/attachment-0001.bin>


More information about the lldb-commits mailing list