diff options
author | Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> | 2023-10-20 19:38:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 19:38:03 +0300 |
commit | 7562ebc6e13ae560de98b00ac96c2d518b0c6639 (patch) | |
tree | 59b01b5319e6dad5b87c241f28d9c54c44f4ef09 /portable | |
parent | a936a1b156450f2454b335f711776c8cce9bc668 (diff) |
Covert object type check to runtime check (#846)
* Covert object type check to runtime check
It was checked using assert earlier.
---------
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Diffstat (limited to 'portable')
-rw-r--r-- | portable/Common/mpu_wrappers_v2.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/portable/Common/mpu_wrappers_v2.c b/portable/Common/mpu_wrappers_v2.c index 87e849edf..beb21d271 100644 --- a/portable/Common/mpu_wrappers_v2.c +++ b/portable/Common/mpu_wrappers_v2.c @@ -324,9 +324,16 @@ static OpaqueObjectHandle_t MPU_GetHandleAtIndex( int32_t lIndex, uint32_t ulKernelObjectType ) /* PRIVILEGED_FUNCTION */ { + OpaqueObjectHandle_t xObjectHandle = NULL; + configASSERT( IS_INTERNAL_INDEX_VALID( lIndex ) != pdFALSE ); - configASSERT( xKernelObjectPool[ lIndex ].ulKernelObjectType == ulKernelObjectType ); - return xKernelObjectPool[ lIndex ].xInternalObjectHandle; + + if( xKernelObjectPool[ lIndex ].ulKernelObjectType == ulKernelObjectType ) + { + xObjectHandle = xKernelObjectPool[ lIndex ].xInternalObjectHandle; + } + + return xObjectHandle; } /*-----------------------------------------------------------*/ |