From: 윤지영/동작제어Lab(SR)/Engineer/삼성전자 Date: Fri, 31 Aug 2018 03:55:34 +0000 (+0900) Subject: Add assertion in ToARMCompute function (#2540) X-Git-Tag: 0.2~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=629f9f1c2a30e2bf3d41be2bb94d2618d16f829f;p=platform%2Fcore%2Fml%2Fnnfw.git Add assertion in ToARMCompute function (#2540) This commit prevents a segfault from wrong access. Signed-off-by: Jiyoung Yun --- diff --git a/runtimes/pure_arm_compute/src/internal/Swizzle.h b/runtimes/pure_arm_compute/src/internal/Swizzle.h index 8d10099..ddf017f 100644 --- a/runtimes/pure_arm_compute/src/internal/Swizzle.h +++ b/runtimes/pure_arm_compute/src/internal/Swizzle.h @@ -22,6 +22,7 @@ private: // Convert T/F Lite / NNAPI axis (based on ...NHWC) to ARMCompute axis (WHCN...) inline ARMComputeAxis ToARMComputeAxis(uint32_t rank, uint32_t axis) { + assert(rank > axis); const ARMComputeAxis reversed{(rank - axis) - 1}; if (rank < 4)