[Lldb-commits] [PATCH] D147833: [lldb] Change return type of EventData::GetFlavor

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Apr 8 13:00:51 PDT 2023


jasonmolenda added a comment.

idk maybe I'm over-thinking it, but this does make me a little uncomfortable.  We have at least one instance where someone did `platform_sp->GetPluginName() == "ios-simulator"` in ClangExpressionSourceCode.cpp (probably to avoid a dependency on an an apple platform plugin in generic code; the code should undoubtedly be done differently) and the mach-o linker on darwin today will unique identical c-strings from separate compilation units, but I doubt that's a guarantee on Darwin or on other platforms.  Platform::GetPluginName is returning a StringRef here, and we naturally see code like this and assume the c-string will be converted to a StringRef or ConstString implicitly for the comparison operator.  But if GetPluginName started returning a pointer to const c-string and the strings aren't uniqued, the comparison fails in a tricky to see way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147833



More information about the lldb-commits mailing list