[Lldb-commits] [PATCH] D60963: Fix dereferencing null pointer

Konrad Wilhelm Kleine via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 13 05:49:27 PDT 2019


kwk added inline comments.


================
Comment at: llvm/lib/Demangle/MicrosoftDemangle.cpp:737
 
 TagTypeNode *Demangler::parseTagUniqueName(StringView &MangledName) {
+  if (!MangledName.consumeFront(".?A")) {
----------------
Why not change the return type to `llvm::Expected<TagTypeNode>`? Then you have one return value that is either an error (when return value evaluates to `false`) or the value. On top of just a boolean `Error` variable you then can also use the return value to store error texts if you need them. Now, I don't know if the `Error` member is used anywhere else. 


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60963





More information about the lldb-commits mailing list