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
374164c2
Commit
374164c2
authored
Jul 25, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #14373: Fixed segmentation fault when gc.collect() is called during
constructing lru_cache (C implementation).
parent
389e3d76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_functoolsmodule.c
Modules/_functoolsmodule.c
+6
-5
No files found.
Misc/NEWS
View file @
374164c2
...
@@ -28,6 +28,9 @@ Core and Builtins
...
@@ -28,6 +28,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #14373: Fixed segmentation fault when gc.collect() is called during
constructing lru_cache (C implementation).
- Issue #24695: Fix a regression in traceback.print_exception(). If
- Issue #24695: Fix a regression in traceback.print_exception(). If
exc_traceback is None we shouldn'
t
print
a
traceback
header
like
described
exc_traceback is None we shouldn'
t
print
a
traceback
header
like
described
in
the
documentation
.
in
the
documentation
.
...
...
Modules/_functoolsmodule.c
View file @
374164c2
...
@@ -899,7 +899,7 @@ bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds
...
@@ -899,7 +899,7 @@ bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds
static
PyObject
*
static
PyObject
*
lru_cache_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kw
)
lru_cache_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kw
)
{
{
PyObject
*
func
,
*
maxsize_O
,
*
cache_info_type
;
PyObject
*
func
,
*
maxsize_O
,
*
cache_info_type
,
*
cachedict
;
int
typed
;
int
typed
;
lru_cache_object
*
obj
;
lru_cache_object
*
obj
;
Py_ssize_t
maxsize
;
Py_ssize_t
maxsize
;
...
@@ -937,15 +937,16 @@ lru_cache_new(PyTypeObject *type, PyObject *args, PyObject *kw)
...
@@ -937,15 +937,16 @@ lru_cache_new(PyTypeObject *type, PyObject *args, PyObject *kw)
return
NULL
;
return
NULL
;
}
}
obj
=
(
lru_cache_object
*
)
type
->
tp_alloc
(
type
,
0
);
if
(
!
(
cachedict
=
PyDict_New
()))
if
(
obj
==
NULL
)
return
NULL
;
return
NULL
;
if
(
!
(
obj
->
cache
=
PyDict_New
()))
{
obj
=
(
lru_cache_object
*
)
type
->
tp_alloc
(
type
,
0
);
Py_DECREF
(
obj
);
if
(
obj
==
NULL
)
{
Py_DECREF
(
cachedict
);
return
NULL
;
return
NULL
;
}
}
obj
->
cache
=
cachedict
;
obj
->
root
.
prev
=
&
obj
->
root
;
obj
->
root
.
prev
=
&
obj
->
root
;
obj
->
root
.
next
=
&
obj
->
root
;
obj
->
root
.
next
=
&
obj
->
root
;
obj
->
maxsize
=
maxsize
;
obj
->
maxsize
=
maxsize
;
...
...
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