mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #28517: Fixed of-by-one error in the peephole optimizer that caused
keeping unreachable code.
This commit is contained in:
		
						commit
						42bcbf76f7
					
				
					 4 changed files with 3114 additions and 3114 deletions
				
			
		|  | @ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1 | ||||||
| Core and Builtins | Core and Builtins | ||||||
| ----------------- | ----------------- | ||||||
| 
 | 
 | ||||||
|  | - Issue #28517: Fixed of-by-one error in the peephole optimizer that caused | ||||||
|  |   keeping unreachable code. | ||||||
|  | 
 | ||||||
| - Issue #28214: Improved exception reporting for problematic __set_name__ | - Issue #28214: Improved exception reporting for problematic __set_name__ | ||||||
|   attributes. |   attributes. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										2298
									
								
								Python/importlib.h
									
										
									
									
									
								
							
							
						
						
									
										2298
									
								
								Python/importlib.h
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							|  | @ -704,11 +704,11 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, | ||||||
|                 /* Remove unreachable ops after RETURN */ |                 /* Remove unreachable ops after RETURN */ | ||||||
|             case RETURN_VALUE: |             case RETURN_VALUE: | ||||||
|                 h = i + 1; |                 h = i + 1; | ||||||
|                 while (h + 1 < codelen && ISBASICBLOCK(blocks, i, h + 1)) { |                 while (h < codelen && ISBASICBLOCK(blocks, i, h)) { | ||||||
|                     h++; |                     h++; | ||||||
|                 } |                 } | ||||||
|                 if (h > i + 1) { |                 if (h > i + 1) { | ||||||
|                     fill_nops(codestr, i + 1, h + 1); |                     fill_nops(codestr, i + 1, h); | ||||||
|                     nexti = find_op(codestr, h); |                     nexti = find_op(codestr, h); | ||||||
|                 } |                 } | ||||||
|                 break; |                 break; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka