Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1365de76
Kaydet (Commit)
1365de76
authored
Nis 08, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix reference leaks in the translate fast path (closes #21175)
Patch by Josh Rosenberg.
üst
fa7e11f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
unicodeobject.c
Objects/unicodeobject.c
+8
-14
No files found.
Objects/unicodeobject.c
Dosyayı görüntüle @
1365de76
...
...
@@ -8551,28 +8551,24 @@ static int
unicode_fast_translate_lookup(PyObject *mapping, Py_UCS1 ch,
Py_UCS1 *translate)
{
PyObject *item;
PyObject *item
= NULL
;
int ret = 0;
item = NULL;
if (charmaptranslate_lookup(ch, mapping, &item)) {
return -1;
}
if (item == Py_None) {
/* deletion
: skip fast translate
*/
/* deletion */
translate[ch] = 0xfe;
return 1;
}
if (item == NULL) {
else if (item == NULL) {
/* not found => default to 1:1 mapping */
translate[ch] = ch;
return 1;
}
if (PyLong_Check(item)) {
long replace = (Py_UCS4)PyLong_AS_LONG(item);
else if (PyLong_Check(item)) {
Py_UCS4 replace = (Py_UCS4)PyLong_AS_LONG(item);
/* PyLong_AS_LONG() cannot fail, charmaptranslate_lookup() already
used it */
if (127 < replace) {
...
...
@@ -8598,15 +8594,13 @@ unicode_fast_translate_lookup(PyObject *mapping, Py_UCS1 ch,
translate[ch] = (Py_UCS1)replace;
}
else {
/* not
a
long or unicode */
/* not
None, NULL,
long or unicode */
goto exit;
}
Py_DECREF(item);
item = NULL;
ret = 1;
exit:
Py_
X
DECREF(item);
exit:
Py_DECREF(item);
return ret;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment