[Lldb-commits] [PATCH] D61805: Add nullptr check in FindLibCppStdFunctionCallableInfo()

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 10 14:29:58 PDT 2019


shafik created this revision.
shafik added reviewers: friss, jingham, aam.

We track down a crash in FindLibCppStdFunctionCallableInfo() to a missing `nullptr` check for the `symbol` variable.


https://reviews.llvm.org/D61805

Files:
  source/Target/CPPLanguageRuntime.cpp


Index: source/Target/CPPLanguageRuntime.cpp
===================================================================
--- source/Target/CPPLanguageRuntime.cpp
+++ source/Target/CPPLanguageRuntime.cpp
@@ -278,7 +278,8 @@
   }
 
   // Case 4 or 5
-  if (!symbol->GetName().GetStringRef().startswith("vtable for")) {
+  if (symbol != nullptr &&
+      !symbol->GetName().GetStringRef().startswith("vtable for")) {
     optional_info.callable_case =
         LibCppStdFunctionCallableCase::FreeOrMemberFunction;
     optional_info.callable_address = function_address_resolved;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61805.199086.patch
Type: text/x-patch
Size: 567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190510/2d8f37e9/attachment.bin>


More information about the lldb-commits mailing list