Commit 2e507a74 authored by Ondřej Zajíček's avatar Ondřej Zajíček

Use non-fatal asserts even for regular build

parent 72163bd5
Pipeline #31536 passed with stages
in 7 minutes and 3 seconds
...@@ -152,9 +152,9 @@ void debug(const char *msg, ...); /* Printf to debug output */ ...@@ -152,9 +152,9 @@ void debug(const char *msg, ...); /* Printf to debug output */
#endif #endif
#ifdef DEBUGGING #ifdef DEBUGGING
#define ASSERT(x) do { if (!(x)) bug("Assertion `%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0) #define ASSERT(x) do { if (!(x)) bug("Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
#else #else
#define ASSERT(x) do { } while(0) #define ASSERT(x) do { if (!(x)) log(L_BUG "Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
#endif #endif
/* Pseudorandom numbers */ /* Pseudorandom numbers */
......
...@@ -437,7 +437,7 @@ static void ...@@ -437,7 +437,7 @@ static void
channel_request_reload(struct channel *c) channel_request_reload(struct channel *c)
{ {
ASSERT(c->channel_state == CS_UP); ASSERT(c->channel_state == CS_UP);
// ASSERT(channel_reloadable(c)); ASSERT(channel_reloadable(c));
c->proto->reload_routes(c); c->proto->reload_routes(c);
......
...@@ -42,8 +42,6 @@ rpki_tr_ssh_open(struct rpki_tr_sock *tr) ...@@ -42,8 +42,6 @@ rpki_tr_ssh_open(struct rpki_tr_sock *tr)
static const char * static const char *
rpki_tr_ssh_ident(struct rpki_tr_sock *tr) rpki_tr_ssh_ident(struct rpki_tr_sock *tr)
{ {
ASSERT(tr != NULL);
struct rpki_cache *cache = tr->cache; struct rpki_cache *cache = tr->cache;
struct rpki_config *cf = (void *) cache->p->p.cf; struct rpki_config *cf = (void *) cache->p->p.cf;
struct rpki_tr_ssh_config *ssh_cf = (void *) cf->tr_config.spec; struct rpki_tr_ssh_config *ssh_cf = (void *) cf->tr_config.spec;
......
...@@ -37,8 +37,6 @@ rpki_tr_tcp_open(struct rpki_tr_sock *tr) ...@@ -37,8 +37,6 @@ rpki_tr_tcp_open(struct rpki_tr_sock *tr)
static const char * static const char *
rpki_tr_tcp_ident(struct rpki_tr_sock *tr) rpki_tr_tcp_ident(struct rpki_tr_sock *tr)
{ {
ASSERT(tr != NULL);
struct rpki_cache *cache = tr->cache; struct rpki_cache *cache = tr->cache;
struct rpki_config *cf = (void *) cache->p->p.cf; struct rpki_config *cf = (void *) cache->p->p.cf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment