This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcdae6d7711d6: [lldb] Fix one leak in reproducer (authored by
MaskRay).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100806/new/
https://reviews.llvm.org/D100806
Files:
lldb/tools/driver/Driver.cpp
Index: lldb/tools/driver/Driver.cpp
===================================================================
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -784,8 +784,8 @@
llvm::outs() << examples << '\n';
}
-llvm::Optional<int> InitializeReproducer(llvm::StringRef argv0,
- opt::InputArgList &input_args) {
+static llvm::Optional<int> InitializeReproducer(llvm::StringRef argv0,
+ opt::InputArgList &input_args)
{
if (auto *finalize_path = input_args.getLastArg(OPT_reproducer_finalize)) {
if (const char *error = SBReproducer::Finalize(finalize_path->getValue()))
{
WithColor::error() << "reproducer finalization failed: " << error <<
'\n';
@@ -853,8 +853,7 @@
// Register the reproducer signal handler.
if (!input_args.hasArg(OPT_no_generate_on_signal)) {
if (const char *reproducer_path = SBReproducer::GetPath()) {
- // Leaking the string on purpose.
- std::string *finalize_cmd = new std::string(argv0);
+ static std::string *finalize_cmd = new std::string(argv0);
finalize_cmd->append(" --reproducer-finalize '");
finalize_cmd->append(reproducer_path);
finalize_cmd->append("'");
Index: lldb/tools/driver/Driver.cpp
===================================================================
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -784,8 +784,8 @@
llvm::outs() << examples << '\n';
}
-llvm::Optional<int> InitializeReproducer(llvm::StringRef argv0,
- opt::InputArgList &input_args) {
+static llvm::Optional<int> InitializeReproducer(llvm::StringRef argv0,
+ opt::InputArgList &input_args) {
if (auto *finalize_path = input_args.getLastArg(OPT_reproducer_finalize)) {
if (const char *error = SBReproducer::Finalize(finalize_path->getValue())) {
WithColor::error() << "reproducer finalization failed: " << error << '\n';
@@ -853,8 +853,7 @@
// Register the reproducer signal handler.
if (!input_args.hasArg(OPT_no_generate_on_signal)) {
if (const char *reproducer_path = SBReproducer::GetPath()) {
- // Leaking the string on purpose.
- std::string *finalize_cmd = new std::string(argv0);
+ static std::string *finalize_cmd = new std::string(argv0);
finalize_cmd->append(" --reproducer-finalize '");
finalize_cmd->append(reproducer_path);
finalize_cmd->append("'");
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits