3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-29 11:55:52 +00:00

Design::selection_stack should never be empty

Add a `log_assert` for it in `Design::check()`.
Remove unneeded checks in other places.
This commit is contained in:
Krystine Sherwin 2025-03-14 14:08:16 +13:00
parent 7eaf33e4da
commit add5eba9b2
No known key found for this signature in database
5 changed files with 15 additions and 19 deletions

View file

@ -715,8 +715,7 @@ static void select_stmt(RTLIL::Design *design, std::string arg, bool disable_emp
if (arg[0] == '%') {
if (arg == "%") {
if (design->selection_stack.size() > 0)
work_stack.push_back(design->selection());
work_stack.push_back(design->selection());
} else
if (arg == "%%") {
while (work_stack.size() > 1) {
@ -1507,7 +1506,7 @@ struct SelectPass : public Pass {
work_stack.pop_back();
}
log_assert(design->selection_stack.size() > 0);
log_assert(!design->selection_stack.empty());
if (clear_mode) {
design->pop_selection();