mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-28 10:19:26 +00:00 
			
		
		
		
	Fixed constant "cond ? string1 : string2" with strings of different size
This commit is contained in:
		
							parent
							
								
									c5eb5e56b8
								
							
						
					
					
						commit
						26cbe4a4e5
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -706,6 +706,8 @@ AstNode *AstNode::mkconst_bits(const std::vector<RTLIL::State> &v, bool is_signe | ||||||
| AstNode *AstNode::mkconst_str(const std::vector<RTLIL::State> &v) | AstNode *AstNode::mkconst_str(const std::vector<RTLIL::State> &v) | ||||||
| { | { | ||||||
| 	AstNode *node = mkconst_str(RTLIL::Const(v).decode_string()); | 	AstNode *node = mkconst_str(RTLIL::Const(v).decode_string()); | ||||||
|  | 	while (GetSize(node->bits) < GetSize(v)) | ||||||
|  | 		node->bits.push_back(RTLIL::State::S0); | ||||||
| 	log_assert(node->bits == v); | 	log_assert(node->bits == v); | ||||||
| 	return node; | 	return node; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue