FreeRTOS-Kernel/FreeRTOS-Plus/Test/CBMC/stubs/cbmc.c
Aniruddha Kanhere cb7edd2323
Sync with a:FR (#75)
* AFR sync

* AFR sync: CBMC

* AFR sync: CBMC: remove .bak files

* AFR sync: CBMC: more cleanup

* Corrected CBMC proofs

* Corrected CBMC patches

* Corrected CBMC patches-1

* Corrected CBMC patches-2

* remove .bak files (3)

Co-authored-by: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
2020-05-28 10:11:58 -07:00

12 lines
446 B
C

#include "cbmc.h"
/****************************************************************
* Model a malloc that can fail (CBMC malloc does not fail) and
* check that CBMC can model an object of the requested size.
****************************************************************/
void * safeMalloc( size_t size )
{
__CPROVER_assert( size < CBMC_MAX_OBJECT_SIZE, "safeMalloc size too big" );
return nondet_bool() ? NULL : malloc( size );
}