5151 } \
5252} while(0)
5353
54- #define ARG_CHECK_NO_RETURN (cond ) do { \
54+ #define ARG_CHECK_VOID (cond ) do { \
5555 if (EXPECT(!(cond), 0)) { \
5656 secp256k1_callback_call(&ctx->illegal_callback, #cond); \
57+ return; \
5758 } \
5859} while(0)
5960
@@ -166,7 +167,7 @@ secp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {
166167}
167168
168169void secp256k1_context_preallocated_destroy (secp256k1_context * ctx ) {
169- ARG_CHECK_NO_RETURN (ctx != secp256k1_context_static );
170+ ARG_CHECK_VOID (ctx != secp256k1_context_static );
170171 if (ctx != NULL ) {
171172 secp256k1_ecmult_gen_context_clear (& ctx -> ecmult_gen_ctx );
172173 }
@@ -183,7 +184,7 @@ void secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void (*fun)(
183184 /* We compare pointers instead of checking secp256k1_context_is_proper() here
184185 because setting callbacks is allowed on *copies* of the static context:
185186 it's harmless and makes testing easier. */
186- ARG_CHECK_NO_RETURN (ctx != secp256k1_context_static );
187+ ARG_CHECK_VOID (ctx != secp256k1_context_static );
187188 if (fun == NULL ) {
188189 fun = secp256k1_default_illegal_callback_fn ;
189190 }
@@ -195,7 +196,7 @@ void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(co
195196 /* We compare pointers instead of checking secp256k1_context_is_proper() here
196197 because setting callbacks is allowed on *copies* of the static context:
197198 it's harmless and makes testing easier. */
198- ARG_CHECK_NO_RETURN (ctx != secp256k1_context_static );
199+ ARG_CHECK_VOID (ctx != secp256k1_context_static );
199200 if (fun == NULL ) {
200201 fun = secp256k1_default_error_callback_fn ;
201202 }
0 commit comments