Skip to content

Commit

Permalink
Covert object type check to runtime check (#846)
Browse files Browse the repository at this point in the history
* Covert object type check to runtime check

It was checked using assert earlier.

---------

Signed-off-by: Gaurav Aggarwal <[email protected]>
  • Loading branch information
aggarg authored Oct 20, 2023
1 parent a936a1b commit 7562ebc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions portable/Common/mpu_wrappers_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
/*-----------------------------------------------------------*/

Expand Down

0 comments on commit 7562ebc

Please sign in to comment.