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
3cedf46c
Kaydet (Commit)
3cedf46c
authored
Eyl 10, 2017
tarafından
Stefan Krah
Kaydeden (comit)
GitHub
Eyl 10, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-31406: Fix crash due to lack of type checking in subclassing. (#3477)
üst
30644dee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
_decimal.c
Modules/_decimal/_decimal.c
+14
-5
No files found.
Modules/_decimal/_decimal.c
Dosyayı görüntüle @
3cedf46c
...
...
@@ -2082,13 +2082,17 @@ dec_from_long(PyTypeObject *type, const PyObject *v,
/* Return a new PyDecObject from a PyLongObject. Use the context for
conversion. */
static
PyObject
*
PyDecType_FromLong
(
PyTypeObject
*
type
,
const
PyObject
*
pylong
,
PyObject
*
context
)
PyDecType_FromLong
(
PyTypeObject
*
type
,
const
PyObject
*
v
,
PyObject
*
context
)
{
PyObject
*
dec
;
uint32_t
status
=
0
;
dec
=
dec_from_long
(
type
,
pylong
,
CTX
(
context
),
&
status
);
if
(
!
PyLong_Check
(
v
))
{
PyErr_SetString
(
PyExc_TypeError
,
"argument must be an integer"
);
return
NULL
;
}
dec
=
dec_from_long
(
type
,
v
,
CTX
(
context
),
&
status
);
if
(
dec
==
NULL
)
{
return
NULL
;
}
...
...
@@ -2104,15 +2108,20 @@ PyDecType_FromLong(PyTypeObject *type, const PyObject *pylong,
/* Return a new PyDecObject from a PyLongObject. Use a maximum context
for conversion. If the conversion is not exact, set InvalidOperation. */
static
PyObject
*
PyDecType_FromLongExact
(
PyTypeObject
*
type
,
const
PyObject
*
pylong
,
PyDecType_FromLongExact
(
PyTypeObject
*
type
,
const
PyObject
*
v
,
PyObject
*
context
)
{
PyObject
*
dec
;
uint32_t
status
=
0
;
mpd_context_t
maxctx
;
if
(
!
PyLong_Check
(
v
))
{
PyErr_SetString
(
PyExc_TypeError
,
"argument must be an integer"
);
return
NULL
;
}
mpd_maxcontext
(
&
maxctx
);
dec
=
dec_from_long
(
type
,
pylong
,
&
maxctx
,
&
status
);
dec
=
dec_from_long
(
type
,
v
,
&
maxctx
,
&
status
);
if
(
dec
==
NULL
)
{
return
NULL
;
}
...
...
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