mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Give error instead of asserting for invalid range, fixes #947
This commit is contained in:
		
							parent
							
								
									2058c7c53b
								
							
						
					
					
						commit
						84ffb21708
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -904,7 +904,8 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
			
		|||
			if (!range_valid)
 | 
			
		||||
				log_file_error(filename, linenum, "Signal `%s' with non-constant width!\n", str.c_str());
 | 
			
		||||
 | 
			
		||||
			log_assert(range_left >= range_right || (range_left == -1 && range_right == 0));
 | 
			
		||||
			if (!(range_left >= range_right || (range_left == -1 && range_right == 0)))
 | 
			
		||||
				log_file_error(filename, linenum, "Signal `%s' with invalid width range %d!\n", str.c_str(), range_left - range_right + 1);
 | 
			
		||||
 | 
			
		||||
			RTLIL::Wire *wire = current_module->addWire(str, range_left - range_right + 1);
 | 
			
		||||
			wire->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue