Add valgrind uninit check to cmovs output
This commit is contained in:
19
src/util.h
19
src/util.h
@@ -69,6 +69,25 @@ static SECP256K1_INLINE void secp256k1_callback_call(const secp256k1_callback *
|
||||
#define VERIFY_SETUP(stmt)
|
||||
#endif
|
||||
|
||||
/* Define `VG_UNDEF` and `VG_CHECK` when VALGRIND is defined */
|
||||
#if !defined(VG_CHECK)
|
||||
# if defined(VALGRIND)
|
||||
# include <valgrind/memcheck.h>
|
||||
# define VG_UNDEF(x,y) VALGRIND_MAKE_MEM_UNDEFINED((x),(y))
|
||||
# define VG_CHECK(x,y) VALGRIND_CHECK_MEM_IS_DEFINED((x),(y))
|
||||
# else
|
||||
# define VG_UNDEF(x,y)
|
||||
# define VG_CHECK(x,y)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Like `VG_CHECK` but on VERIFY only */
|
||||
#if defined(VERIFY)
|
||||
#define VG_CHECK_VERIFY(x,y) VG_CHECK((x), (y))
|
||||
#else
|
||||
#define VG_CHECK_VERIFY(x,y)
|
||||
#endif
|
||||
|
||||
static SECP256K1_INLINE void *checked_malloc(const secp256k1_callback* cb, size_t size) {
|
||||
void *ret = malloc(size);
|
||||
if (ret == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user