mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Issue #22869: Remove duplicate stack check from pythonrun.c
This commit is contained in:
		
							parent
							
								
									fc9fdedd09
								
							
						
					
					
						commit
						9b59dd4781
					
				
					 1 changed files with 0 additions and 37 deletions
				
			
		|  | @ -1376,43 +1376,6 @@ err_input(perrdetail *err) | |||
| } | ||||
| 
 | ||||
| 
 | ||||
| #if defined(USE_STACKCHECK) | ||||
| #if defined(WIN32) && defined(_MSC_VER) | ||||
| 
 | ||||
| /* Stack checking for Microsoft C */ | ||||
| 
 | ||||
| #include <malloc.h> | ||||
| #include <excpt.h> | ||||
| 
 | ||||
| /*
 | ||||
|  * Return non-zero when we run out of memory on the stack; zero otherwise. | ||||
|  */ | ||||
| int | ||||
| PyOS_CheckStack(void) | ||||
| { | ||||
|     __try { | ||||
|         /* alloca throws a stack overflow exception if there's
 | ||||
|            not enough space left on the stack */ | ||||
|         alloca(PYOS_STACK_MARGIN * sizeof(void*)); | ||||
|         return 0; | ||||
|     } __except (GetExceptionCode() == STATUS_STACK_OVERFLOW ? | ||||
|                     EXCEPTION_EXECUTE_HANDLER : | ||||
|             EXCEPTION_CONTINUE_SEARCH) { | ||||
|         int errcode = _resetstkoflw(); | ||||
|         if (errcode == 0) | ||||
|         { | ||||
|             Py_FatalError("Could not reset the stack!"); | ||||
|         } | ||||
|     } | ||||
|     return 1; | ||||
| } | ||||
| 
 | ||||
| #endif /* WIN32 && _MSC_VER */ | ||||
| 
 | ||||
| /* Alternate implementations can be added here... */ | ||||
| 
 | ||||
| #endif /* USE_STACKCHECK */ | ||||
| 
 | ||||
| /* Deprecated C API functions still provided for binary compatiblity */ | ||||
| 
 | ||||
| #undef PyParser_SimpleParseFile | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Steve Dower
						Steve Dower