nickdesaulniers marked an inline comment as done.
nickdesaulniers added inline comments.
================
Comment at: llvm/lib/Demangle/Demangle.cpp:49
bool llvm::nonMicrosoftDemangle(const char *MangledName, std::string &Result) {
+ if (!MangledName)
+ return false;
----------------
nickdesaulniers wrote:
> MaskRay wrote:
> > Why is this change? The original contract is that `MangledName` must be
> > non-null.
> https://fosstodon.org/@llvm/110397650834821908
>
> It's insidious; implicitly constructing a `std::string_view` from a `char*`
> which is `nullptr` invokes a call to `strlen` upon construction, which
> segfaults on my system. Therefor, all of the `nullptr` checks need to be
> hoisted into the callers or stated another way exist at the boundary of
> `char*` to `std::string_view` API boundaries (such as right here).
This is also why the `nullptr` input test case must be removed from
llvm/unittests/Demangle/DLangDemangleTest.cpp below.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151003/new/
https://reviews.llvm.org/D151003
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits