| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a9e00d1 commit 53fa8b2
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -292,7 +292,7 @@ iso2022processesc(const void *config, MultibyteCodec_State *state, | |||
| 292 | 292 | const unsigned char **inbuf, Py_ssize_t *inleft) | |
| 293 | 293 | { | |
| 294 | 294 | unsigned char charset, designation; | |
| 295 | - Py_ssize_t i, esclen; | ||
| 295 | + Py_ssize_t i, esclen = 0; | ||
| 296 | 296 | ||
| 297 | 297 | for (i = 1;i < MAX_ESCSEQLEN;i++) { | |
| 298 | 298 | if (i >= *inleft) | |
@@ -307,10 +307,9 @@ iso2022processesc(const void *config, MultibyteCodec_State *state, | |||
| 307 | 307 | } | |
| 308 | 308 | } | |
| 309 | 309 | ||
| 310 | - if (i >= MAX_ESCSEQLEN) | ||
| 311 | - return 1; /* unterminated escape sequence */ | ||
| 312 | - | ||
| 313 | 310 | switch (esclen) { | |
| 311 | + case 0: | ||
| 312 | + return 1; /* unterminated escape sequence */ | ||
| 314 | 313 | case 3: | |
| 315 | 314 | if (INBYTE2 == '$') { | |
| 316 | 315 | charset = INBYTE3 | CHARSET_DBCS; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -458,7 +458,7 @@ faulthandler_thread(void *unused) | |||
| 458 | 458 | assert(st == PY_LOCK_FAILURE); | |
| 459 | 459 | ||
| 460 | 460 | /* get the thread holding the GIL, NULL if no thread hold the GIL */ | |
| 461 | - current = _Py_atomic_load_relaxed(&_PyThreadState_Current); | ||
| 461 | + current = (PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current); | ||
| 462 | 462 | ||
| 463 | 463 | write(thread.fd, thread.header, (int)thread.header_len); | |
| 464 | 464 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -191,7 +191,7 @@ static void drop_gil(PyThreadState *tstate) | |||
| 191 | 191 | if (_Py_atomic_load_relaxed(&gil_drop_request) && tstate != NULL) { | |
| 192 | 192 | MUTEX_LOCK(switch_mutex); | |
| 193 | 193 | /* Not switched yet => wait */ | |
| 194 | - if (_Py_atomic_load_relaxed(&gil_last_holder) == tstate) { | ||
| 194 | + if ((PyThreadState*)_Py_atomic_load_relaxed(&gil_last_holder) == tstate) { | ||
| 195 | 195 | RESET_GIL_DROP_REQUEST(); | |
| 196 | 196 | /* NOTE: if COND_WAIT does not atomically start waiting when | |
| 197 | 197 | releasing the mutex, another thread can run through, take | |
@@ -239,7 +239,7 @@ static void take_gil(PyThreadState *tstate) | |||
| 239 | 239 | _Py_atomic_store_relaxed(&gil_locked, 1); | |
| 240 | 240 | _Py_ANNOTATE_RWLOCK_ACQUIRED(&gil_locked, /*is_write=*/1); | |
| 241 | 241 | ||
| 242 | - if (tstate != _Py_atomic_load_relaxed(&gil_last_holder)) { | ||
| 242 | + if (tstate != (PyThreadState*)_Py_atomic_load_relaxed(&gil_last_holder)) { | ||
| 243 | 243 | _Py_atomic_store_relaxed(&gil_last_holder, tstate); | |
| 244 | 244 | ++gil_switch_number; | |
| 245 | 245 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1258,7 +1258,7 @@ Py_FatalError(const char *msg) | |||
| 1258 | 1258 | PyErr_PrintEx(0); | |
| 1259 | 1259 | } | |
| 1260 | 1260 | else { | |
| 1261 | - tstate = _Py_atomic_load_relaxed(&_PyThreadState_Current); | ||
| 1261 | + tstate = (PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current); | ||
| 1262 | 1262 | if (tstate != NULL) { | |
| 1263 | 1263 | fputc('\n', stderr); | |
| 1264 | 1264 | fflush(stderr); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -403,7 +403,7 @@ tstate_delete_common(PyThreadState *tstate) | |||
| 403 | 403 | void | |
| 404 | 404 | PyThreadState_Delete(PyThreadState *tstate) | |
| 405 | 405 | { | |
| 406 | - if (tstate == _Py_atomic_load_relaxed(&_PyThreadState_Current)) | ||
| 406 | + if (tstate == (PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) | ||
| 407 | 407 | Py_FatalError("PyThreadState_Delete: tstate is still current"); | |
| 408 | 408 | #ifdef WITH_THREAD | |
| 409 | 409 | if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate) | |
@@ -662,7 +662,7 @@ PyThreadState_IsCurrent(PyThreadState *tstate) | |||
| 662 | 662 | { | |
| 663 | 663 | /* Must be the tstate for this thread */ | |
| 664 | 664 | assert(PyGILState_GetThisThreadState()==tstate); | |
| 665 | - return tstate == _Py_atomic_load_relaxed(&_PyThreadState_Current); | ||
| 665 | + return tstate == (PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current); | ||
| 666 | 666 | } | |
| 667 | 667 | ||
| 668 | 668 | /* Internal initialization/finalization functions called by | |
| Back | FazBrowse Home | New Git URL |
0 commit comments