mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
prevent eventual invalid state change from int8 overflow
This commit is contained in:
parent
0c9b3fc8b7
commit
bff7c03f26
1 changed files with 8 additions and 0 deletions
8
queue.c
8
queue.c
|
@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue