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
36577e4e
Kaydet (Commit)
36577e4e
authored
Tem 26, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #15893: frozenmain.c now handles PyMem_Malloc() failure
üst
70c94e78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
python.c
Modules/python.c
+10
-6
frozenmain.c
Python/frozenmain.c
+9
-2
No files found.
Modules/python.c
Dosyayı görüntüle @
36577e4e
...
@@ -18,11 +18,19 @@ wmain(int argc, wchar_t **argv)
...
@@ -18,11 +18,19 @@ wmain(int argc, wchar_t **argv)
int
int
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
wchar_t
**
argv_copy
=
(
wchar_t
**
)
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
(
argc
+
1
))
;
wchar_t
**
argv_copy
;
/* We need a second copy, as Python might modify the first one. */
/* We need a second copy, as Python might modify the first one. */
wchar_t
**
argv_copy2
=
(
wchar_t
**
)
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
(
argc
+
1
))
;
wchar_t
**
argv_copy2
;
int
i
,
res
;
int
i
,
res
;
char
*
oldloc
;
char
*
oldloc
;
argv_copy
=
(
wchar_t
**
)
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
(
argc
+
1
));
argv_copy2
=
(
wchar_t
**
)
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
(
argc
+
1
));
if
(
!
argv_copy
||
!
argv_copy2
)
{
fprintf
(
stderr
,
"out of memory
\n
"
);
return
1
;
}
/* 754 requires that FP exceptions run in "no stop" mode by default,
/* 754 requires that FP exceptions run in "no stop" mode by default,
* and until C vendors implement C99's ways to control FP exceptions,
* and until C vendors implement C99's ways to control FP exceptions,
* Python requires non-stop mode. Alas, some platforms enable FP
* Python requires non-stop mode. Alas, some platforms enable FP
...
@@ -34,10 +42,6 @@ main(int argc, char **argv)
...
@@ -34,10 +42,6 @@ main(int argc, char **argv)
m
=
fpgetmask
();
m
=
fpgetmask
();
fpsetmask
(
m
&
~
FP_X_OFL
);
fpsetmask
(
m
&
~
FP_X_OFL
);
#endif
#endif
if
(
!
argv_copy
||
!
argv_copy2
)
{
fprintf
(
stderr
,
"out of memory
\n
"
);
return
1
;
}
oldloc
=
strdup
(
setlocale
(
LC_ALL
,
NULL
));
oldloc
=
strdup
(
setlocale
(
LC_ALL
,
NULL
));
setlocale
(
LC_ALL
,
""
);
setlocale
(
LC_ALL
,
""
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
...
...
Python/frozenmain.c
Dosyayı görüntüle @
36577e4e
...
@@ -20,9 +20,16 @@ Py_FrozenMain(int argc, char **argv)
...
@@ -20,9 +20,16 @@ Py_FrozenMain(int argc, char **argv)
int
inspect
=
0
;
int
inspect
=
0
;
int
unbuffered
=
0
;
int
unbuffered
=
0
;
char
*
oldloc
;
char
*
oldloc
;
wchar_t
**
argv_copy
=
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
argc
)
;
wchar_t
**
argv_copy
;
/* We need a second copies, as Python might modify the first one. */
/* We need a second copies, as Python might modify the first one. */
wchar_t
**
argv_copy2
=
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
argc
);
wchar_t
**
argv_copy2
;
argv_copy
=
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
argc
);
argv_copy2
=
PyMem_Malloc
(
sizeof
(
wchar_t
*
)
*
argc
);
if
(
!
argv_copy
||
!
argv_copy2
)
{
fprintf
(
stderr
,
"out of memory
\n
"
);
return
1
;
}
Py_FrozenFlag
=
1
;
/* Suppress errors from getpath.c */
Py_FrozenFlag
=
1
;
/* Suppress errors from getpath.c */
...
...
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