Check that we got back an object from MakeFunctionCaller
authorJason Molenda <jmolenda@apple.com>
Thu, 27 Oct 2016 23:52:46 +0000 (23:52 +0000)
committerJason Molenda <jmolenda@apple.com>
Thu, 27 Oct 2016 23:52:46 +0000 (23:52 +0000)
before we call through it.

<rdar://problem/28979705>

llvm-svn: 285369

lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp

index a4d73ee..9d0f0da 100644 (file)
@@ -188,7 +188,7 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction(
       get_item_info_caller = m_get_item_info_impl_code->MakeFunctionCaller(
           get_item_info_return_type, get_item_info_arglist,
           thread.shared_from_this(), error);
-      if (error.Fail()) {
+      if (error.Fail() || get_item_info_caller == nullptr) {
         if (log)
           log->Printf("Error Inserting get-item-info function: \"%s\".",
                       error.AsCString());
index 452d319..38bf336 100644 (file)
@@ -192,7 +192,7 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction(
           m_get_pending_items_impl_code->MakeFunctionCaller(
               get_pending_items_return_type, get_pending_items_arglist,
               thread_sp, error);
-      if (error.Fail()) {
+      if (error.Fail() || get_pending_items_caller == nullptr) {
         if (log)
           log->Printf("Failed to install pending-items introspection function "
                       "caller: %s.",
index fc3da32..3994c28 100644 (file)
@@ -205,7 +205,7 @@ AppleGetQueuesHandler::SetupGetQueuesFunction(Thread &thread,
     Error error;
     get_queues_caller = m_get_queues_impl_code_up->MakeFunctionCaller(
         get_queues_return_type, get_queues_arglist, thread_sp, error);
-    if (error.Fail()) {
+    if (error.Fail() || get_queues_caller == nullptr) {
       if (log)
         log->Printf(
             "Could not get function caller for get-queues function: %s.",
index d3ab0fa..4ed43e5 100644 (file)
@@ -203,7 +203,7 @@ lldb::addr_t AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction(
           m_get_thread_item_info_impl_code->MakeFunctionCaller(
               get_thread_item_info_return_type, get_thread_item_info_arglist,
               thread_sp, error);
-      if (error.Fail()) {
+      if (error.Fail() || get_thread_item_info_caller == nullptr) {
         if (log)
           log->Printf("Failed to install get-thread-item-info introspection "
                       "caller: %s.",