mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Fix PyCode_Addr2Location when addrq < 0 (GH-95091)
This commit is contained in:
		
							parent
							
								
									834bd5dd76
								
							
						
					
					
						commit
						a6daaf2a13
					
				
					 2 changed files with 3 additions and 0 deletions
				
			
		|  | @ -0,0 +1,2 @@ | ||||||
|  | Undocumented ``PyCode_Addr2Location`` function now properly returns when | ||||||
|  | ``addrq`` argument is less than zero. | ||||||
|  | @ -971,6 +971,7 @@ PyCode_Addr2Location(PyCodeObject *co, int addrq, | ||||||
|     if (addrq < 0) { |     if (addrq < 0) { | ||||||
|         *start_line = *end_line = co->co_firstlineno; |         *start_line = *end_line = co->co_firstlineno; | ||||||
|         *start_column = *end_column = 0; |         *start_column = *end_column = 0; | ||||||
|  |         return 1; | ||||||
|     } |     } | ||||||
|     assert(addrq >= 0 && addrq < _PyCode_NBYTES(co)); |     assert(addrq >= 0 && addrq < _PyCode_NBYTES(co)); | ||||||
|     PyCodeAddressRange bounds; |     PyCodeAddressRange bounds; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ken Jin
						Ken Jin