mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-24076: Fix reference in sum() introduced by GH-28469 (GH-28493)
This commit is contained in:
		
							parent
							
								
									9a0dcc5b2e
								
							
						
					
					
						commit
						1c7e98dc25
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -2484,7 +2484,8 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start) | |||
|                 /* Single digits are common, fast, and cannot overflow on unpacking. */ | ||||
|                 switch (Py_SIZE(item)) { | ||||
|                     case -1: b = -(sdigit) ((PyLongObject*)item)->ob_digit[0]; break; | ||||
|                     case  0: continue; | ||||
|                     // Note: the continue goes to the top of the "while" loop that iterates over the elements
 | ||||
|                     case  0: Py_DECREF(item); continue;  | ||||
|                     case  1: b = ((PyLongObject*)item)->ob_digit[0]; break; | ||||
|                     default: b = PyLong_AsLongAndOverflow(item, &overflow); break; | ||||
|                 } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Pablo Galindo Salgado
						Pablo Galindo Salgado