From 5828ffdff817bbc93dba5384fa67b934ae6fb2b4 Mon Sep 17 00:00:00 2001 From: Chunseok Lee Date: Wed, 9 Sep 2020 12:58:01 +0900 Subject: [PATCH] Fix coverity 1148326 - Fix coverity 1148326 Change-Id: I98d2ff22050078bd8a392a58904b968965c1c46d Signed-off-by: Chunseok Lee --- compute/ARMComputeEx/src/runtime/CL/functions/CLReduceOperation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compute/ARMComputeEx/src/runtime/CL/functions/CLReduceOperation.cpp b/compute/ARMComputeEx/src/runtime/CL/functions/CLReduceOperation.cpp index 321d5c5..b198e73 100644 --- a/compute/ARMComputeEx/src/runtime/CL/functions/CLReduceOperation.cpp +++ b/compute/ARMComputeEx/src/runtime/CL/functions/CLReduceOperation.cpp @@ -120,7 +120,10 @@ void CLReduceOperation::configure(ICLTensor *input, ICLTensor *output, const size_t num_of_kernels = axis.size(); const size_t num_of_interm_tensors = num_of_kernels - (keep_dims ? 1 : 0); - ARM_COMPUTE_ERROR_ON(num_of_kernels < 1); + if (num_of_kernels < 1) + { + throw std::runtime_error("CLReduceOperation: there is no axis to reduce"); + } _interm_tensors = support::cpp14::make_unique(num_of_interm_tensors); _reduce_kernels = support::cpp14::make_unique(num_of_kernels); -- 2.7.4