lib: add pre condition asserts to check current thread has no error
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 8 Nov 2019 22:19:13 +0000 (17:19 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 11 Nov 2019 18:53:14 +0000 (13:53 -0500)
commit17f3083a0b4d318d3303c8a5bfa63db6a874ec73
tree8fb8d70a4c9d87414b0b87d22951e78ee1ee6512
parent6ecdcca3de0dea694cdfb252160c7939f7dc2ef1
lib: add pre condition asserts to check current thread has no error

The user must not call an API function while the current thread has an
error set, especially a function that can itself fail and set an error.
Otherwise, causes from two unrelated errors will end up in the same
stack, which will produce some misleading information.

Add a precondition assertion to all API functions that are likely to
themselves set an error to the current thread, to verify that there is
not error on the current thread when they are called.

Change-Id: I9aadbc4e00d06f3e893970c7c8891dbe7c68606b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
32 files changed:
src/lib/assert-pre.h
src/lib/graph/component-class-sink-simple.c
src/lib/graph/component-class.c
src/lib/graph/component-descriptor-set.c
src/lib/graph/component-filter.c
src/lib/graph/component-sink.c
src/lib/graph/component-source.c
src/lib/graph/graph.c
src/lib/graph/interrupter.c
src/lib/graph/iterator.c
src/lib/graph/message/discarded-items.c
src/lib/graph/message/event.c
src/lib/graph/message/message-iterator-inactivity.c
src/lib/graph/message/packet.c
src/lib/graph/message/stream.c
src/lib/graph/mip.c
src/lib/graph/query-executor.c
src/lib/integer-range-set.c
src/lib/plugin/plugin.c
src/lib/trace-ir/clock-class.c
src/lib/trace-ir/clock-snapshot.c
src/lib/trace-ir/event-class.c
src/lib/trace-ir/field-class.c
src/lib/trace-ir/field.c
src/lib/trace-ir/packet-context-field.c
src/lib/trace-ir/packet.c
src/lib/trace-ir/stream-class.c
src/lib/trace-ir/stream.c
src/lib/trace-ir/trace-class.c
src/lib/trace-ir/trace.c
src/lib/util.c
src/lib/value.c
This page took 0.027472 seconds and 4 git commands to generate.