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
690c36f2
Kaydet (Commit)
690c36f2
authored
Eki 31, 2017
tarafından
Pablo Galindo
Kaydeden (comit)
Victor Stinner
Eki 31, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[3.6] bpo-31852: Fix segfault caused by using the async soft keyword (GH-4122)
üst
27023808
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
test_tokenize.py
Lib/test/test_tokenize.py
+5
-0
2017-10-27-19-18-44.bpo-31852.P_4cVr.rst
...ore and Builtins/2017-10-27-19-18-44.bpo-31852.P_4cVr.rst
+2
-0
tokenizer.c
Parser/tokenizer.c
+10
-0
No files found.
Lib/test/test_tokenize.py
Dosyayı görüntüle @
690c36f2
...
...
@@ -630,6 +630,11 @@ def"', """\
NAME 'async' (1, 0) (1, 5)
OP '=' (1, 6) (1, 7)
NUMBER '1' (1, 8) (1, 9)
"""
)
self
.
check_tokenize
(
"async
\\
"
,
"""
\
ERRORTOKEN '
\\\\
' (1, 5) (1, 6)
NAME 'async' (1, 0) (1, 5)
"""
)
self
.
check_tokenize
(
"a = (async = 1)"
,
"""
\
...
...
Misc/NEWS.d/next/Core and Builtins/2017-10-27-19-18-44.bpo-31852.P_4cVr.rst
0 → 100644
Dosyayı görüntüle @
690c36f2
Fix a segmentation fault caused by a combination of the async soft keyword
and continuation lines.
Parser/tokenizer.c
Dosyayı görüntüle @
690c36f2
...
...
@@ -1563,6 +1563,9 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end)
/* The current token is 'async'.
Look ahead one token.*/
int
async_def_prev
=
tok
->
async_def
;
tok
->
async_def
=
2
;
struct
tok_state
ahead_tok
;
char
*
ahead_tok_start
=
NULL
,
*
ahead_tok_end
=
NULL
;
int
ahead_tok_kind
;
...
...
@@ -1581,6 +1584,9 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end)
tok
->
async_def
=
1
;
return
ASYNC
;
}
else
{
tok
->
async_def
=
async_def_prev
;
}
}
}
...
...
@@ -1844,6 +1850,10 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end)
/* Line continuation */
if
(
c
==
'\\'
)
{
c
=
tok_nextc
(
tok
);
if
(
tok
->
async_def
==
2
)
{
tok
->
done
=
E_SYNTAX
;
return
ERRORTOKEN
;
}
if
(
c
!=
'\n'
)
{
tok
->
done
=
E_LINECONT
;
tok
->
cur
=
tok
->
inp
;
...
...
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