[Tarantool-patches] [PATCH 2.X v4 4/4] module api: box_ibuf_* wrappers

Alexander Turenko alexander.turenko at tarantool.org
Wed Oct 14 06:31:17 MSK 2020


> +void
> +box_ibuf_read_range(box_ibuf_t *ibuf, char ***rpos, char ***wpos)
> +{
> +	assert(ibuf != NULL);
> +	if (ibuf == NULL)
> +		return;

So it'll not (at least stochastically) fail on ibuf pointer
dereferencing on RelWithDebInfo, but will just silently ignore the usage
error. I guess it is the bad pattern. At least I don't see anything
similar in our code: we either assert() or fail with setting an error to
the diagnostics area and returning of -1 / NULL or kinda.

So I propose to jeave assert(), but remove the if (ibuf == NULL) {<...>}.

Don't forget to update box_ibuf_write_range() in sync (not it has no
assert()).


More information about the Tarantool-patches mailing list