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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 14 Nov 2019 22:49:46 +0000 (17:49 -0500)
commit7c7324d323dc3354309e3994714697a84db2c404
tree90bed85126e0c519ab5397e0cef860fefb2fa738
parentd6f6a5aa1207fc66091bb6cc8d6fe376d89328ac
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.027114 seconds and 4 git commands to generate.