python3: Fix thread patch

This commit is contained in:
Alexey Pavlov
2017-07-14 10:38:34 +03:00
parent 25647af886
commit 04027fb8a7
2 changed files with 5 additions and 2 deletions

View File

@@ -48,7 +48,7 @@
/* If the thread had an associated auto thread state, reassociate it with
--- Python-3.6.0/Python/thread_pthread.h.orig 2016-12-22 21:21:22.000000000 -0500
+++ Python-3.6.0/Python/thread_pthread.h 2017-02-08 05:18:45.791168100 -0500
@@ -603,36 +603,36 @@
@@ -603,36 +603,39 @@
#define Py_HAVE_NATIVE_TLS
@@ -62,6 +62,8 @@
- return -1;
- if (key > INT_MAX) {
+ return -1L;
+#ifndef __CYGWIN__
+ /* Cygwin pthread types are pointers, which may "overflow" signed long */
+ if (key > LONG_MAX) {
/* Issue #22206: handle integer overflow */
pthread_key_delete(key);
@@ -70,6 +72,7 @@
+ return -1L;
}
- return (int)key;
+#endif
+ return (long)key;
}

View File

@@ -64,7 +64,7 @@ sha256sums=('a01810ddfcec216bcdb357a84bfaafdfaa0ca42bbdaa4cb7ff74f5a9961e4041'
'7a7425b5fa28b7692bafff226981650748d7f40a42a711378b9a9c8b23a98060'
'6ead37259110c28b16e35e05c93c82b46aa0fbb5152ff61bdaf1eea5f1ad01da'
'f5b67408d39d3fda539ea90b12c48a05bd950b38460ec3e6a688e3377b071ed3'
'73083aebc0ed9ce34bd52b1aeef73f7bcb3b27dff81967276562101e41dfaa5a'
'dba84d6a24a54a66d14e969fbbf366666a7376b667802bdf98f06d8ee1c91b8c'
'c09d3612d748852def0bcd1cb36dda7bd24366ed6b386743c800c7cb21eb0298'
'e668b749e5f0bc584262add2cd7fffb2f6f32393a14918029d791012eda930f3'
'30564663c1f2cd7d0d10a2b07eceb139534f17bc3a38dc8daafad0d5111e8bbc'