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
0661e91f
Kaydet (Commit)
0661e91f
authored
Mar 15, 2011
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 11510: Fix BUILD_SET optimizer bug.
üst
31f218bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
test_peepholer.py
Lib/test/test_peepholer.py
+13
-1
peephole.c
Python/peephole.c
+2
-1
No files found.
Lib/test/test_peepholer.py
Dosyayı görüntüle @
0661e91f
...
...
@@ -294,11 +294,23 @@ class TestTranforms(unittest.TestCase):
self
.
assertNotIn
(
'BINARY_'
,
asm
,
e
)
self
.
assertNotIn
(
'BUILD_'
,
asm
,
e
)
class
TestBuglets
(
unittest
.
TestCase
):
def
test_bug_11510
(
self
):
# folded constant set optimization was commingled with the tuple
# unpacking optimization which would fail if the set had duplicate
# elements so that the set length was unexpected
def
f
():
x
,
y
=
{
1
,
1
}
return
x
,
y
with
self
.
assertRaises
(
ValueError
):
f
()
def
test_main
(
verbose
=
None
):
import
sys
from
test
import
support
test_classes
=
(
TestTranforms
,)
test_classes
=
(
TestTranforms
,
TestBuglets
)
support
.
run_unittest
(
*
test_classes
)
# verify reference counting
...
...
Python/peephole.c
Dosyayı görüntüle @
0661e91f
...
...
@@ -535,7 +535,8 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
}
if
(
codestr
[
i
+
3
]
!=
UNPACK_SEQUENCE
||
!
ISBASICBLOCK
(
blocks
,
i
,
6
)
||
j
!=
GETARG
(
codestr
,
i
+
3
))
j
!=
GETARG
(
codestr
,
i
+
3
)
||
opcode
==
BUILD_SET
)
continue
;
if
(
j
==
1
)
{
memset
(
codestr
+
i
,
NOP
,
6
);
...
...
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