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
d12bd012
Kaydet (Commit)
d12bd012
authored
Tem 21, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Handle more memory allocation failures without crashing.
üst
33722aec
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
8 deletions
+38
-8
ast.c
Python/ast.c
+4
-2
compile.c
Python/compile.c
+9
-0
pythonrun.c
Python/pythonrun.c
+13
-4
symtable.c
Python/symtable.c
+10
-2
thread.c
Python/thread.c
+2
-0
No files found.
Python/ast.c
Dosyayı görüntüle @
d12bd012
...
@@ -638,8 +638,10 @@ ast_for_arguments(struct compiling *c, const node *n)
...
@@ -638,8 +638,10 @@ ast_for_arguments(struct compiling *c, const node *n)
anything other than EQUAL or a comma? */
anything other than EQUAL or a comma? */
/* XXX Should NCH(n) check be made a separate check? */
/* XXX Should NCH(n) check be made a separate check? */
if
(
i
+
1
<
NCH
(
n
)
&&
TYPE
(
CHILD
(
n
,
i
+
1
))
==
EQUAL
)
{
if
(
i
+
1
<
NCH
(
n
)
&&
TYPE
(
CHILD
(
n
,
i
+
1
))
==
EQUAL
)
{
asdl_seq_SET
(
defaults
,
j
++
,
expr_ty
expression
=
ast_for_expr
(
c
,
CHILD
(
n
,
i
+
2
));
ast_for_expr
(
c
,
CHILD
(
n
,
i
+
2
)));
if
(
!
expression
)
goto
error
;
asdl_seq_SET
(
defaults
,
j
++
,
expression
);
i
+=
2
;
i
+=
2
;
found_default
=
1
;
found_default
=
1
;
}
}
...
...
Python/compile.c
Dosyayı görüntüle @
d12bd012
...
@@ -1105,8 +1105,17 @@ compiler_enter_scope(struct compiler *c, identifier name, void *key,
...
@@ -1105,8 +1105,17 @@ compiler_enter_scope(struct compiler *c, identifier name, void *key,
u
->
u_name
=
name
;
u
->
u_name
=
name
;
u
->
u_varnames
=
list2dict
(
u
->
u_ste
->
ste_varnames
);
u
->
u_varnames
=
list2dict
(
u
->
u_ste
->
ste_varnames
);
u
->
u_cellvars
=
dictbytype
(
u
->
u_ste
->
ste_symbols
,
CELL
,
0
,
0
);
u
->
u_cellvars
=
dictbytype
(
u
->
u_ste
->
ste_symbols
,
CELL
,
0
,
0
);
if
(
!
u
->
u_varnames
||
!
u
->
u_cellvars
)
{
compiler_unit_free
(
u
);
return
0
;
}
u
->
u_freevars
=
dictbytype
(
u
->
u_ste
->
ste_symbols
,
FREE
,
DEF_FREE_CLASS
,
u
->
u_freevars
=
dictbytype
(
u
->
u_ste
->
ste_symbols
,
FREE
,
DEF_FREE_CLASS
,
PyDict_Size
(
u
->
u_cellvars
));
PyDict_Size
(
u
->
u_cellvars
));
if
(
!
u
->
u_freevars
)
{
compiler_unit_free
(
u
);
return
0
;
}
u
->
u_blocks
=
NULL
;
u
->
u_blocks
=
NULL
;
u
->
u_tmpname
=
0
;
u
->
u_tmpname
=
0
;
...
...
Python/pythonrun.c
Dosyayı görüntüle @
d12bd012
...
@@ -1204,8 +1204,12 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals,
...
@@ -1204,8 +1204,12 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals,
{
{
PyObject
*
ret
=
NULL
;
PyObject
*
ret
=
NULL
;
PyArena
*
arena
=
PyArena_New
();
PyArena
*
arena
=
PyArena_New
();
mod_ty
mod
=
PyParser_ASTFromString
(
str
,
"<string>"
,
start
,
flags
,
mod_ty
mod
;
arena
);
if
(
arena
==
NULL
)
return
NULL
;
mod
=
PyParser_ASTFromString
(
str
,
"<string>"
,
start
,
flags
,
arena
);
if
(
mod
!=
NULL
)
if
(
mod
!=
NULL
)
ret
=
run_mod
(
mod
,
"<string>"
,
globals
,
locals
,
flags
,
arena
);
ret
=
run_mod
(
mod
,
"<string>"
,
globals
,
locals
,
flags
,
arena
);
PyArena_Free
(
arena
);
PyArena_Free
(
arena
);
...
@@ -1218,8 +1222,13 @@ PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals,
...
@@ -1218,8 +1222,13 @@ PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals,
{
{
PyObject
*
ret
;
PyObject
*
ret
;
PyArena
*
arena
=
PyArena_New
();
PyArena
*
arena
=
PyArena_New
();
mod_ty
mod
=
PyParser_ASTFromFile
(
fp
,
filename
,
start
,
0
,
0
,
mod_ty
mod
;
flags
,
NULL
,
arena
);
if
(
arena
==
NULL
)
return
NULL
;
mod
=
PyParser_ASTFromFile
(
fp
,
filename
,
start
,
0
,
0
,
flags
,
NULL
,
arena
);
if
(
mod
==
NULL
)
{
if
(
mod
==
NULL
)
{
PyArena_Free
(
arena
);
PyArena_Free
(
arena
);
return
NULL
;
return
NULL
;
...
...
Python/symtable.c
Dosyayı görüntüle @
d12bd012
...
@@ -221,8 +221,12 @@ PySymtable_Build(mod_ty mod, const char *filename, PyFutureFeatures *future)
...
@@ -221,8 +221,12 @@ PySymtable_Build(mod_ty mod, const char *filename, PyFutureFeatures *future)
return
st
;
return
st
;
st
->
st_filename
=
filename
;
st
->
st_filename
=
filename
;
st
->
st_future
=
future
;
st
->
st_future
=
future
;
symtable_enter_block
(
st
,
GET_IDENTIFIER
(
top
),
ModuleBlock
,
if
(
!
symtable_enter_block
(
st
,
GET_IDENTIFIER
(
top
),
ModuleBlock
,
(
void
*
)
mod
,
0
);
(
void
*
)
mod
,
0
))
{
PySymtable_Free
(
st
);
return
NULL
;
}
st
->
st_top
=
st
->
st_cur
;
st
->
st_top
=
st
->
st_cur
;
st
->
st_cur
->
ste_unoptimized
=
OPT_TOPLEVEL
;
st
->
st_cur
->
ste_unoptimized
=
OPT_TOPLEVEL
;
/* Any other top-level initialization? */
/* Any other top-level initialization? */
...
@@ -728,6 +732,8 @@ symtable_exit_block(struct symtable *st, void *ast)
...
@@ -728,6 +732,8 @@ symtable_exit_block(struct symtable *st, void *ast)
if
(
end
>=
0
)
{
if
(
end
>=
0
)
{
st
->
st_cur
=
(
PySTEntryObject
*
)
PyList_GET_ITEM
(
st
->
st_stack
,
st
->
st_cur
=
(
PySTEntryObject
*
)
PyList_GET_ITEM
(
st
->
st_stack
,
end
);
end
);
if
(
st
->
st_cur
==
NULL
)
return
0
;
Py_INCREF
(
st
->
st_cur
);
Py_INCREF
(
st
->
st_cur
);
if
(
PySequence_DelItem
(
st
->
st_stack
,
end
)
<
0
)
if
(
PySequence_DelItem
(
st
->
st_stack
,
end
)
<
0
)
return
0
;
return
0
;
...
@@ -749,6 +755,8 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
...
@@ -749,6 +755,8 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
Py_DECREF
(
st
->
st_cur
);
Py_DECREF
(
st
->
st_cur
);
}
}
st
->
st_cur
=
PySTEntry_New
(
st
,
name
,
block
,
ast
,
lineno
);
st
->
st_cur
=
PySTEntry_New
(
st
,
name
,
block
,
ast
,
lineno
);
if
(
st
->
st_cur
==
NULL
)
return
0
;
if
(
name
==
GET_IDENTIFIER
(
top
))
if
(
name
==
GET_IDENTIFIER
(
top
))
st
->
st_global
=
st
->
st_cur
->
ste_symbols
;
st
->
st_global
=
st
->
st_cur
->
ste_symbols
;
if
(
prev
)
{
if
(
prev
)
{
...
...
Python/thread.c
Dosyayı görüntüle @
d12bd012
...
@@ -267,6 +267,8 @@ find_key(int key, void *value)
...
@@ -267,6 +267,8 @@ find_key(int key, void *value)
struct
key
*
p
;
struct
key
*
p
;
long
id
=
PyThread_get_thread_ident
();
long
id
=
PyThread_get_thread_ident
();
if
(
!
keymutex
)
return
NULL
;
PyThread_acquire_lock
(
keymutex
,
1
);
PyThread_acquire_lock
(
keymutex
,
1
);
for
(
p
=
keyhead
;
p
!=
NULL
;
p
=
p
->
next
)
{
for
(
p
=
keyhead
;
p
!=
NULL
;
p
=
p
->
next
)
{
if
(
p
->
id
==
id
&&
p
->
key
==
key
)
if
(
p
->
id
==
id
&&
p
->
key
==
key
)
...
...
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