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
d2b4c19d
Unverified
Kaydet (Commit)
d2b4c19d
authored
Şub 01, 2019
tarafından
Guido van Rossum
Kaydeden (comit)
GitHub
Şub 01, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-35879: Fix type comment leaks (GH-11728)
* Fix leak for # type: ignore * Fix the type comment leak
üst
ac19081c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
parsetok.c
Parser/parsetok.c
+1
-0
ast.c
Python/ast.c
+8
-3
No files found.
Parser/parsetok.c
Dosyayı görüntüle @
d2b4c19d
...
@@ -330,6 +330,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
...
@@ -330,6 +330,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
}
}
if
(
type
==
TYPE_IGNORE
)
{
if
(
type
==
TYPE_IGNORE
)
{
PyObject_FREE
(
str
);
if
(
!
growable_int_array_add
(
&
type_ignores
,
tok
->
lineno
))
{
if
(
!
growable_int_array_add
(
&
type_ignores
,
tok
->
lineno
))
{
err_ret
->
error
=
E_NOMEM
;
err_ret
->
error
=
E_NOMEM
;
break
;
break
;
...
...
Python/ast.c
Dosyayı görüntüle @
d2b4c19d
...
@@ -699,11 +699,16 @@ ast_error(struct compiling *c, const node *n, const char *errmsg, ...)
...
@@ -699,11 +699,16 @@ ast_error(struct compiling *c, const node *n, const char *errmsg, ...)
*/
*/
static
string
static
string
new_type_comment
(
const
char
*
s
)
new_type_comment
(
const
char
*
s
,
struct
compiling
*
c
)
{
{
return
PyUnicode_DecodeUTF8
(
s
,
strlen
(
s
),
NULL
);
PyObject
*
res
=
PyUnicode_DecodeUTF8
(
s
,
strlen
(
s
),
NULL
);
if
(
PyArena_AddPyObject
(
c
->
c_arena
,
res
)
<
0
)
{
Py_DECREF
(
res
);
return
NULL
;
}
return
res
;
}
}
#define NEW_TYPE_COMMENT(n) new_type_comment(STR(n))
#define NEW_TYPE_COMMENT(n) new_type_comment(STR(n)
, c
)
static
int
static
int
num_stmts
(
const
node
*
n
)
num_stmts
(
const
node
*
n
)
...
...
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