[PATCH] D60963: Fix dereferencing null pointer

Konrad Wilhelm Kleine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 00:46:57 PDT 2019


kwk marked an inline comment as done.
kwk added inline comments.


================
Comment at: llvm/lib/Demangle/MicrosoftDemangle.cpp:737
 
 TagTypeNode *Demangler::parseTagUniqueName(StringView &MangledName) {
+  if (!MangledName.consumeFront(".?A")) {
----------------
thakis wrote:
> kwk wrote:
> > 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. 
> Error is not a parameter, it's class-level state that's used pervasively in this file.
Okay, was just a thought. Thanks for explaining.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60963





More information about the llvm-commits mailing list