Rewrote side-effectful assertion such that VeriFast can process it.

This commit is contained in:
Tobias Reinhard 2022-11-10 12:51:20 -05:00
parent 7e75d7aa8f
commit 63d8c5afa8

View file

@ -4173,7 +4173,15 @@ void vTaskSwitchContext( BaseType_t xCoreID )
{ {
/* vTaskSwitchContext() must never be called from within a critical section. /* vTaskSwitchContext() must never be called from within a critical section.
* This is not necessarily true for vanilla FreeRTOS, but it is for this SMP port. */ * This is not necessarily true for vanilla FreeRTOS, but it is for this SMP port. */
#ifdef VERIFAST
/* Reason for rewrite: VeriFast cannot handle non-pure assertions. */
{
UBaseType_t nesting = pxCurrentTCB->uxCriticalNesting;
configASSERT( nesting == 0 );
}
#else
configASSERT( pxCurrentTCB->uxCriticalNesting == 0 ); configASSERT( pxCurrentTCB->uxCriticalNesting == 0 );
#endif /* VERIFAST */
if( uxSchedulerSuspended != ( UBaseType_t ) pdFALSE ) if( uxSchedulerSuspended != ( UBaseType_t ) pdFALSE )
{ {