prevent eventual invalid state change from int8 overflow

This commit is contained in:
David Chalco 2020-06-22 13:37:55 -07:00
parent 0c9b3fc8b7
commit bff7c03f26

View file

@ -1095,6 +1095,8 @@ Queue_t * const pxQueue = xQueue;
{ {
/* Increment the lock count so the task that unlocks the queue /* Increment the lock count so the task that unlocks the queue
knows that data was posted while it was locked. */ knows that data was posted while it was locked. */
configASSERT( pxQueue->cTxLock != INT8_MAX );
pxQueue->cTxLock = ( int8_t ) ( cTxLock + 1 ); pxQueue->cTxLock = ( int8_t ) ( cTxLock + 1 );
} }
@ -1260,6 +1262,8 @@ Queue_t * const pxQueue = xQueue;
{ {
/* Increment the lock count so the task that unlocks the queue /* Increment the lock count so the task that unlocks the queue
knows that data was posted while it was locked. */ knows that data was posted while it was locked. */
configASSERT( pxQueue->cTxLock != INT8_MAX );
pxQueue->cTxLock = ( int8_t ) ( cTxLock + 1 ); pxQueue->cTxLock = ( int8_t ) ( cTxLock + 1 );
} }
@ -1859,6 +1863,8 @@ Queue_t * const pxQueue = xQueue;
{ {
/* Increment the lock count so the task that unlocks the queue /* Increment the lock count so the task that unlocks the queue
knows that data was removed while it was locked. */ knows that data was removed while it was locked. */
configASSERT( pxQueue->cRxLock != INT8_MAX );
pxQueue->cRxLock = ( int8_t ) ( cRxLock + 1 ); pxQueue->cRxLock = ( int8_t ) ( cRxLock + 1 );
} }
@ -2922,6 +2928,8 @@ Queue_t * const pxQueue = xQueue;
} }
else else
{ {
configASSERT( pxQueueSetContainer->cTxLock != INT8_MAX );
pxQueueSetContainer->cTxLock = ( int8_t ) ( cTxLock + 1 ); pxQueueSetContainer->cTxLock = ( int8_t ) ( cTxLock + 1 );
} }
} }