diff --git a/src/orange/orangeinp/detail/DeMorganSimplifier.cc b/src/orange/orangeinp/detail/DeMorganSimplifier.cc index da6f1a8872..f6ab7a592a 100644 --- a/src/orange/orangeinp/detail/DeMorganSimplifier.cc +++ b/src/orange/orangeinp/detail/DeMorganSimplifier.cc @@ -135,19 +135,20 @@ void DeMorganSimplifier::find_join_negations() }, [&](Joined const& joined) { handle_joined(node_id, joined); }, [&](Aliased const& aliased) { - auto const& alias_target = tree_[aliased.node]; + auto const* target_node = &tree_[aliased.node]; + CELER_EXPECT( + !std::holds_alternative(*target_node)); // treat the aliased node as its target - if (std::holds_alternative(alias_target)) + if (Negated const* negated + = std::get_if(target_node)) { - handle_negated(node_id, - std::get(alias_target)); + handle_negated(node_id, *negated); } - else if (std::holds_alternative(alias_target)) + else if (Joined const* joined + = std::get_if(target_node)) { - handle_joined(node_id, std::get(alias_target)); + handle_joined(node_id, *joined); } - CELER_EXPECT( - !std::holds_alternative(alias_target)); }, // Nothing to do for leaf node types [](auto&&) {},