aboutsummaryrefslogtreecommitdiff
path: root/delegate/common/src/DelegateUtils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'delegate/common/src/DelegateUtils.hpp')
-rw-r--r--delegate/common/src/DelegateUtils.hpp7
1 files changed, 5 insertions, 2 deletions
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<int>(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<unsigned int>(wrappedIndex);
};