Covert object type check to runtime check (#847)

It was checked using assert earlier.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Gaurav-Aggarwal-AWS 2023-10-20 22:08:19 +05:30 committed by GitHub
parent d9fc48bced
commit 52c1c6e578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
/*-----------------------------------------------------------*/