mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-28 10:19:26 +00:00 
			
		
		
		
	Do not modify design modules while iterating over modules().
				
					
				
			Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
This commit is contained in:
		
							parent
							
								
									985a29ff3b
								
							
						
					
					
						commit
						e49fdee404
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -1423,11 +1423,14 @@ struct FlattenPass : public Pass { | |||
| 							new_used_modules.insert(cell->type); | ||||
| 			} | ||||
| 
 | ||||
| 			std::set<RTLIL::Module *> to_remove; | ||||
| 			for (auto mod : design->modules()) | ||||
| 				if (!used_modules[mod->name] && !mod->get_blackbox_attribute(worker.ignore_wb)) { | ||||
| 					log("Deleting now unused module %s.\n", log_id(mod)); | ||||
| 					design->remove(mod); | ||||
| 					to_remove.insert(mod); | ||||
| 				} | ||||
| 			for (auto mod : to_remove) | ||||
| 				design->remove(mod); | ||||
| 		} | ||||
| 
 | ||||
| 		log_pop(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue