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/common/src/DelegateUtils.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'delegate/common') diff --git a/delegate/common/src/DelegateUtils.hpp b/delegate/common/src/DelegateUtils.hpp index 418cad313f..a74ed8b549 100644 --- a/delegate/common/src/DelegateUtils.hpp +++ b/delegate/common/src/DelegateUtils.hpp @@ -109,8 +109,11 @@ unsigned int ComputeWrappedIndex(int index, unsigned int numDimensions) { int numDims = armnn::numeric_cast(numDimensions); int wrappedIndex = index < 0 ? numDims + index : index; - ARMNN_ASSERT(wrappedIndex >= 0); - ARMNN_ASSERT(wrappedIndex < numDims); + + if (wrappedIndex < 0 || wrappedIndex >= numDims) + { + throw armnn::ParseException("Unable to compute wrapped index"); + } return static_cast(wrappedIndex); }; -- cgit v1.2.1