From afffecae1c567bac1622d4f168ff7c3828ec3b51 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 21:10:02 +0100 Subject: Cleanup: Work around clang-tidy bug For some reason clang-tidy thinks that insert can modify the value of tail_block, so this triggers a null dereference warning. If that were true, it would be true with things swapped around like this as well, but it makes the warning go away at least. --- src/server/events/Connect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index dda1821b..dd5b32a9 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -114,9 +114,6 @@ Connect::pre_process(PreProcessContext& ctx) if (tail_block != head_block && tail_block->parent() == head_block->parent()) { // Connection is between blocks inside a graph, compile graph - // The tail block is now a dependency (provider) of the head block - head_block->providers().insert(tail_block); - if (!dynamic_cast(tail_block)) { /* Arcs leaving a delay node are ignored for the purposes of compilation, since the output is from the previous cycle and @@ -125,6 +122,9 @@ Connect::pre_process(PreProcessContext& ctx) tail_block->dependants().insert(head_block); } + // The tail block is now a dependency (provider) of the head block + head_block->providers().insert(tail_block); + if (ctx.must_compile(*_graph)) { if (!(_compiled_graph = compile(*_engine.maid(), *_graph))) { head_block->providers().erase(tail_block); -- cgit v1.2.1