diff --git a/lib/regexec.c b/lib/regexec.c index 5e4eb497a..bd5b4ea41 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -1675,6 +1675,7 @@ static reg_errcode_t clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx) { Idx top = mctx->state_log_top; + DEBUG_ASSERT (mctx->state_log != NULL); if ((next_state_log_idx >= mctx->input.bufs_len && mctx->input.bufs_len < mctx->input.len) diff --git a/lib/verify.h b/lib/verify.h index a8ca59b09..3cd71b280 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -305,6 +305,8 @@ template --enable-gcc-warnings, which compiles with -Dlint. It's nicer when 'assume' silences warnings even with older GCCs. */ # define assume(R) ((R) ? (void) 0 : __builtin_trap ()) +#elif defined __COVERITY__ +# define assume(R) ((R) ? (void) 0 : __coverity_panic__ ()) #else /* Some tools grok NOTREACHED, e.g., Oracle Studio 12.6. */ # define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)