mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-11 22:25:14 -05:00
Guarded unsafe decrements of uxTopReadyPriority and uxCurrentPriority
This commit is contained in:
parent
136b1d69b2
commit
99d46f9e51
1 changed files with 16 additions and 1 deletions
17
tasks.c
17
tasks.c
|
|
@ -1365,7 +1365,15 @@ static void prvYieldForTask( TCB_t * pxTCB,
|
||||||
{
|
{
|
||||||
if( xDecrementTopPriority != pdFALSE )
|
if( xDecrementTopPriority != pdFALSE )
|
||||||
{
|
{
|
||||||
|
#if VERIFAST
|
||||||
|
/* Reason for rewrite: Code not memory safe.
|
||||||
|
*/
|
||||||
|
if(uxTopReadyPriority > 0) {
|
||||||
uxTopReadyPriority--;
|
uxTopReadyPriority--;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
uxTopReadyPriority--;
|
||||||
|
#endif /* VERIFAST */
|
||||||
#if ( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configNUM_CORES > 1 ) )
|
#if ( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configNUM_CORES > 1 ) )
|
||||||
{
|
{
|
||||||
xPriorityDropped = pdTRUE;
|
xPriorityDropped = pdTRUE;
|
||||||
|
|
@ -1403,9 +1411,16 @@ static void prvYieldForTask( TCB_t * pxTCB,
|
||||||
configASSERT( ( uxCurrentPriority > tskIDLE_PRIORITY ) || ( xTaskScheduled == pdTRUE ) );
|
configASSERT( ( uxCurrentPriority > tskIDLE_PRIORITY ) || ( xTaskScheduled == pdTRUE ) );
|
||||||
#endif /* VERIFAST */
|
#endif /* VERIFAST */
|
||||||
|
|
||||||
//@ assume(uxCurrentPriority > 0);
|
|
||||||
|
|
||||||
|
#if VERIFAST
|
||||||
|
/* Reason for rewrite: Code not memory safe.
|
||||||
|
*/
|
||||||
|
if(uxCurrentPriority > 0) {
|
||||||
uxCurrentPriority--;
|
uxCurrentPriority--;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
uxCurrentPriority--;
|
||||||
|
#endif /* VERIFAST */
|
||||||
|
|
||||||
// @ close xLIST(gReadyList, gSize, gIndex, gEnd, gCells, gVals, gOwners);
|
// @ close xLIST(gReadyList, gSize, gIndex, gEnd, gCells, gVals, gOwners);
|
||||||
// @ assert( xLIST(gReadyList, ?gReadyListSize, _, _, gCells, gVals, gOwners) );
|
// @ assert( xLIST(gReadyList, ?gReadyListSize, _, _, gCells, gVals, gOwners) );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue