jankratochvil added a comment.

Have you run the build with address sanitizer?



================
Comment at: lldb/source/Commands/CommandObjectCommands.cpp:530
     OptionsWithRaw args_with_suffix(raw_command_line);
-    const char *remainder = args_with_suffix.GetRawPart().c_str();
+    llvm::StringRef raw_command_string = args_with_suffix.GetRawPart();
 
----------------
The `raw_command_string` definition does not need to be moved above the 
`ParseOptionsAndNotify` call, it could stay in place lower.


================
Comment at: lldb/source/Commands/CommandObjectCommands.cpp:1173
 
-    // TODO: Convert these functions to return StringRefs.
-    const char *GetHelp() {
-      return (m_help.empty() ? nullptr : m_help.c_str());
-    }
+    llvm::StringRef GetHelp() { return (m_help.empty() ? "" : m_help); }
 
----------------
I see no need for the conditional there.


================
Comment at: lldb/source/Commands/CommandObjectCommands.cpp:1175
 
-    const char *GetSyntax() {
-      return (m_syntax.empty() ? nullptr : m_syntax.c_str());
-    }
+    llvm::StringRef GetSyntax() { return (m_syntax.empty() ? "" : m_syntax); }
 
----------------
I see no need for the conditional there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76569



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to