labath added inline comments.

================
Comment at: source/Core/RichManglingContext.cpp:134-135
         get<CPlusPlusLanguage::MethodName>(m_cxx_method_parser)->GetBasename();
+    if (!m_buffer.data())
+      m_buffer = llvm::StringRef("", 0);
     return;
----------------
Why is this necessary? It looks like somebody is misusing the returned 
StringRef by assuming that it always points to at least a single valid byte 
(which is definitely not the case in general, even for StringRefs with a 
non-null `data()`).

It would be better to fix the caller instead.


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

https://reviews.llvm.org/D53759



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

Reply via email to