From 4ab59a99346463d30ea0c6274c9b0704b36478c9 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:40:55 +1300 Subject: [PATCH] select.cc: Fix %i when rhs is empty --- passes/cmds/select.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc index c42c0ead27c..bb1055c676c 100644 --- a/passes/cmds/select.cc +++ b/passes/cmds/select.cc @@ -431,9 +431,17 @@ static void select_op_intersect(RTLIL::Design *design, RTLIL::Selection &lhs, co if (rhs.full_selection && !lhs.selects_boxes) return; - if (lhs.empty() || rhs.empty()) + if (lhs.empty()) return; + if (rhs.empty()) { + lhs.full_selection = false; + lhs.complete_selection = false; + lhs.selected_modules.clear(); + lhs.selected_members.clear(); + return; + } + select_all(design, lhs); std::vector del_list;