Skip to content
Snippets Groups Projects
Commit 53a3dd0e authored by Kostyantyn Vorobyov's avatar Kostyantyn Vorobyov
Browse files

Extra assertions in bittree

parent 2d6a53e8
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,23 @@ ...@@ -28,6 +28,23 @@
#include "e_acsl_bittree.h" #include "e_acsl_bittree.h"
/* Assertions in debug mode */
#define ALLOCATED(_ptr,_size) \
((allocated(_ptr, _size, _ptr) == NULL) ? 0 : 1)
#ifdef E_ACSL_DEBUG
#define DVALIDATE_RO_ACCESS(_ptr, _size) \
vassert(ALLOCATED(_ptr, _size), \
"Not allocated [%a, %a + %lu]", (uintptr_t)_ptr, _size)
#define DVALIDATE_RW_ACCESS(_ptr, _size) { \
DVALIDATE_RO_ACCESS(_ptr, _size); \
vassert(!readonly(_ptr), "Location %a is read-only", (uintptr_t)_ptr); \
}
#else
#define DVALIDATE_RO_ACCESS(_ptr, _size)
#define DVALIDATE_RW_ACCESS(_ptr, _size)
#endif
/**************************/ /**************************/
/* SUPPORT {{{ */ /* SUPPORT {{{ */
/**************************/ /**************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment