Skip to content

Commit 9b59dd4

Browse files
committed
Issue python#22869: Remove duplicate stack check from pythonrun.c
1 parent fc9fded commit 9b59dd4

1 file changed

Lines changed: 0 additions & 37 deletions

File tree

Python/pythonrun.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,43 +1376,6 @@ err_input(perrdetail *err)
13761376
}
13771377

13781378

1379-
#if defined(USE_STACKCHECK)
1380-
#if defined(WIN32) && defined(_MSC_VER)
1381-
1382-
/* Stack checking for Microsoft C */
1383-
1384-
#include <malloc.h>
1385-
#include <excpt.h>
1386-
1387-
/*
1388-
* Return non-zero when we run out of memory on the stack; zero otherwise.
1389-
*/
1390-
int
1391-
PyOS_CheckStack(void)
1392-
{
1393-
__try {
1394-
/* alloca throws a stack overflow exception if there's
1395-
not enough space left on the stack */
1396-
alloca(PYOS_STACK_MARGIN * sizeof(void*));
1397-
return 0;
1398-
} __except (GetExceptionCode() == STATUS_STACK_OVERFLOW ?
1399-
EXCEPTION_EXECUTE_HANDLER :
1400-
EXCEPTION_CONTINUE_SEARCH) {
1401-
int errcode = _resetstkoflw();
1402-
if (errcode == 0)
1403-
{
1404-
Py_FatalError("Could not reset the stack!");
1405-
}
1406-
}
1407-
return 1;
1408-
}
1409-
1410-
#endif /* WIN32 && _MSC_VER */
1411-
1412-
/* Alternate implementations can be added here... */
1413-
1414-
#endif /* USE_STACKCHECK */
1415-
14161379
/* Deprecated C API functions still provided for binary compatiblity */
14171380

14181381
#undef PyParser_SimpleParseFile

0 commit comments

Comments
 (0)