From c229b3fd81b42140c0fa8731e90bc07323cec794 Mon Sep 17 00:00:00 2001 From: Ryan OShea Date: Tue, 27 Jun 2023 22:34:54 +0100 Subject: IVGCVSW-7676 Audit the use of ARMNN_ASSERT * Replace most ARMNN_ASSERT's from tflite parser * Replace most ARMNN_ASSERT's from onnx parser * Replace some ARMNN_ASSERT's from tflite delegate * Replace some ARMNN_ASSERT;s from include files Signed-off-by: Ryan OShea Change-Id: Ie052e0180060203f28f64ebf54acad298f431caf --- delegate/classic/src/armnn_delegate.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'delegate/classic/src/armnn_delegate.cpp') diff --git a/delegate/classic/src/armnn_delegate.cpp b/delegate/classic/src/armnn_delegate.cpp index 2483835989..de2aa0c632 100644 --- a/delegate/classic/src/armnn_delegate.cpp +++ b/delegate/classic/src/armnn_delegate.cpp @@ -312,7 +312,12 @@ TfLiteStatus ArmnnSubgraph::AddOutputLayer(DelegateData& delegateData, armnn::IConnectableLayer* layer = delegateData.m_Network->AddOutputLayer(bindingId); auto tensorInfo = GetTensorInfoForTfLiteTensor(tensor); - ARMNN_ASSERT(delegateData.m_OutputSlotForNode[static_cast(tensorId)] != nullptr); + + if (delegateData.m_OutputSlotForNode[static_cast(tensorId)] == nullptr) + { + return kTfLiteError; + } + delegateData.m_OutputSlotForNode[static_cast(tensorId)]->Connect(layer->GetInputSlot(0)); outputBindings.push_back(std::make_pair(bindingId, tensorInfo)); } -- cgit v1.2.1