Skip to content

Commit

Permalink
Fix Ubuntu Release build test for WTO
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler authored and elazarg committed Oct 23, 2021
1 parent f0986fa commit 292f063
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/crab/wto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ void wto_t::start_visit(const label_t& vertex, wto_partition_t& partition, std::
}
}

// Create a new cycle component inside the containing cycle.
auto cycle = std::make_shared<wto_cycle_t>(containing_cycle);

if (head_dfn == vertex_data.dfn) {
vertex_data.dfn = INT_MAX;
label_t& element = _stack.top();
Expand Down
12 changes: 11 additions & 1 deletion src/crab/wto_cycle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,18 @@ class wto_cycle_t final {
inline std::ostream& operator<<(std::ostream& o, wto_cycle_t& cycle) {
o << "( ";
for (auto& component : cycle) {
std::visit([&o](auto& e) -> std::ostream& { return o << e; }, *component);
wto_component_t* c = component.get();

// For some reason, an Ubuntu Release build can't find the right
// function to call via std::visit and just outputs a pointer
// value, so we force it to use the right one here.
if (std::holds_alternative<std::shared_ptr<class wto_cycle_t>>(*c)) {
auto ptr = std::get<std::shared_ptr<class wto_cycle_t>>(*c);
o << *ptr;
} else
std::visit([&o](auto& e) -> std::ostream& { return o << e; }, *component);
o << " ";

}
o << ")";
return o;
Expand Down

0 comments on commit 292f063

Please sign in to comment.