summaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-03-06 14:47:02 -0800
committerSteve Dower <steve.dower@microsoft.com>2015-03-06 14:47:02 -0800
commit6139bc8c6c02db0e084b495d1fe5ac9707635ecb (patch)
tree954af07252726deb10918fa585f9fd620475fe84 /Python/pystate.c
parent50b1836c7923d3a0460ad78076fd955aeda0f61c (diff)
downloadcpython-6139bc8c6c02db0e084b495d1fe5ac9707635ecb.tar.gz
Issue #23524: Replace _PyVerify_fd function with calling _set_thread_local_invalid_parameter_handler on every thread.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 32a635c789..ee1e469635 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -22,6 +22,12 @@ to avoid the expense of doing their own locking).
#endif
#endif
+#if defined _MSC_VER && _MSC_VER >= 1900
+/* Issue #23524: Temporary fix to disable termination due to invalid parameters */
+PyAPI_DATA(void*) _Py_silent_invalid_parameter_handler;
+#include <stdlib.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -222,6 +228,11 @@ new_threadstate(PyInterpreterState *interp, int init)
tstate->next->prev = tstate;
interp->tstate_head = tstate;
HEAD_UNLOCK();
+
+#if defined _MSC_VER && _MSC_VER >= 1900
+ /* Issue #23524: Temporary fix to disable termination due to invalid parameters */
+ _set_thread_local_invalid_parameter_handler((_invalid_parameter_handler)_Py_silent_invalid_parameter_handler);
+#endif
}
return tstate;