mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	fix udivmod crashes when operand value exceeds logical width
This commit is contained in:
		
							parent
							
								
									c550c301dc
								
							
						
					
					
						commit
						b693947834
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -2010,7 +2010,7 @@ std::pair<value<BitsY>, value<BitsY>> divmod_uu(const value<BitsA> &a, const val
 | 
			
		|||
	value<Bits> quotient;
 | 
			
		||||
	value<Bits> remainder;
 | 
			
		||||
	value<Bits> dividend = a.template zext<Bits>();
 | 
			
		||||
	value<Bits> divisor = b.template zext<Bits>();
 | 
			
		||||
	value<Bits> divisor  = b.template trunc<BitsB>().template zext<Bits>();
 | 
			
		||||
	std::tie(quotient, remainder) = dividend.udivmod(divisor);
 | 
			
		||||
	return {quotient.template trunc<BitsY>(), remainder.template trunc<BitsY>()};
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue