From a235f3d3a950830d37b27edb50a3fbe7b5be32e5 Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Wed, 24 Mar 2021 06:21:11 +0000 Subject: [PATCH] Add assert to catch invalid task priority Signed-off-by: Gaurav Aggarwal --- tasks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks.c b/tasks.c index 988e32bdb..7d01384d8 100644 --- a/tasks.c +++ b/tasks.c @@ -913,8 +913,8 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, pxNewTCB->pcTaskName[ 0 ] = 0x00; } - /* This is used as an array index so must ensure it's not too large. First - * remove the privilege bit if one is present. */ + /* This is used as an array index so must ensure it's not too large. */ + configASSERT( ( uxPriority < configMAX_PRIORITIES ) ); if( uxPriority >= ( UBaseType_t ) configMAX_PRIORITIES ) { uxPriority = ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) 1U;