Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
59865e7f
Commit
59865e7f
authored
Apr 11, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #26200: Restored more safe usages of Py_SETREF.
parents
a29f7204
864b63c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
Modules/_decimal/_decimal.c
Modules/_decimal/_decimal.c
+4
-4
Modules/_functoolsmodule.c
Modules/_functoolsmodule.c
+3
-3
Objects/floatobject.c
Objects/floatobject.c
+2
-2
No files found.
Modules/_decimal/_decimal.c
View file @
59865e7f
...
@@ -3439,14 +3439,14 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
...
@@ -3439,14 +3439,14 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
goto
error
;
goto
error
;
}
}
Py_
X
SETREF
(
exponent
,
long_methods
->
nb_power
(
tmp
,
exponent
,
Py_None
));
Py_SETREF
(
exponent
,
long_methods
->
nb_power
(
tmp
,
exponent
,
Py_None
));
Py_DECREF
(
tmp
);
Py_DECREF
(
tmp
);
if
(
exponent
==
NULL
)
{
if
(
exponent
==
NULL
)
{
goto
error
;
goto
error
;
}
}
if
(
exp
>=
0
)
{
if
(
exp
>=
0
)
{
Py_
X
SETREF
(
numerator
,
long_methods
->
nb_multiply
(
numerator
,
exponent
));
Py_SETREF
(
numerator
,
long_methods
->
nb_multiply
(
numerator
,
exponent
));
if
(
numerator
==
NULL
)
{
if
(
numerator
==
NULL
)
{
goto
error
;
goto
error
;
}
}
...
@@ -3462,8 +3462,8 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
...
@@ -3462,8 +3462,8 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
if
(
tmp
==
NULL
)
{
if
(
tmp
==
NULL
)
{
goto
error
;
goto
error
;
}
}
Py_
X
SETREF
(
numerator
,
long_methods
->
nb_floor_divide
(
numerator
,
tmp
));
Py_SETREF
(
numerator
,
long_methods
->
nb_floor_divide
(
numerator
,
tmp
));
Py_
X
SETREF
(
denominator
,
long_methods
->
nb_floor_divide
(
denominator
,
tmp
));
Py_SETREF
(
denominator
,
long_methods
->
nb_floor_divide
(
denominator
,
tmp
));
Py_DECREF
(
tmp
);
Py_DECREF
(
tmp
);
if
(
numerator
==
NULL
||
denominator
==
NULL
)
{
if
(
numerator
==
NULL
||
denominator
==
NULL
)
{
goto
error
;
goto
error
;
...
...
Modules/_functoolsmodule.c
View file @
59865e7f
...
@@ -294,9 +294,9 @@ partial_setstate(partialobject *pto, PyObject *state)
...
@@ -294,9 +294,9 @@ partial_setstate(partialobject *pto, PyObject *state)
else
else
Py_INCREF
(
dict
);
Py_INCREF
(
dict
);
Py_
X
SETREF
(
pto
->
fn
,
fn
);
Py_SETREF
(
pto
->
fn
,
fn
);
Py_
X
SETREF
(
pto
->
args
,
fnargs
);
Py_SETREF
(
pto
->
args
,
fnargs
);
Py_
X
SETREF
(
pto
->
kw
,
kw
);
Py_SETREF
(
pto
->
kw
,
kw
);
Py_XSETREF
(
pto
->
dict
,
dict
);
Py_XSETREF
(
pto
->
dict
,
dict
);
Py_RETURN_NONE
;
Py_RETURN_NONE
;
}
}
...
...
Objects/floatobject.c
View file @
59865e7f
...
@@ -1494,13 +1494,13 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
...
@@ -1494,13 +1494,13 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
/* fold in 2**exponent */
/* fold in 2**exponent */
if
(
exponent
>
0
)
{
if
(
exponent
>
0
)
{
Py_
X
SETREF
(
numerator
,
Py_SETREF
(
numerator
,
long_methods
->
nb_lshift
(
numerator
,
py_exponent
));
long_methods
->
nb_lshift
(
numerator
,
py_exponent
));
if
(
numerator
==
NULL
)
if
(
numerator
==
NULL
)
goto
error
;
goto
error
;
}
}
else
{
else
{
Py_
X
SETREF
(
denominator
,
Py_SETREF
(
denominator
,
long_methods
->
nb_lshift
(
denominator
,
py_exponent
));
long_methods
->
nb_lshift
(
denominator
,
py_exponent
));
if
(
denominator
==
NULL
)
if
(
denominator
==
NULL
)
goto
error
;
goto
error
;
...
...
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