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
a3626bc5
Commit
a3626bc5
authored
Jul 15, 2015
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #24583: Fix crash when set is mutated while being updated.
parent
ced770da
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
Lib/test/test_set.py
Lib/test/test_set.py
+13
-0
Misc/NEWS
Misc/NEWS
+2
-0
Objects/setobject.c
Objects/setobject.c
+2
-1
No files found.
Lib/test/test_set.py
View file @
a3626bc5
...
...
@@ -1742,6 +1742,19 @@ class TestWeirdBugs(unittest.TestCase):
s
.
update
(
range
(
100
))
list
(
si
)
def
test_merge_and_mutate
(
self
):
class
X
:
def
__hash__
(
self
):
return
hash
(
0
)
def
__eq__
(
self
,
o
):
other
.
clear
()
return
False
other
=
set
()
other
=
{
X
()
for
i
in
range
(
10
)}
s
=
{
0
}
s
.
update
(
other
)
# Application tests (based on David Eppstein's graph recipes ====================================
def
powerset
(
U
):
...
...
Misc/NEWS
View file @
a3626bc5
...
...
@@ -12,6 +12,8 @@ Core and Builtins
- Issue #24569: Make PEP 448 dictionary evaluation more consistent.
- Issue #24583: Fix crash when set is mutated while being updated.
- Issue #24407: Fix crash when dict is mutated while being updated.
Library
...
...
Objects/setobject.c
View file @
a3626bc5
...
...
@@ -600,7 +600,8 @@ set_merge(PySetObject *so, PyObject *otherset)
}
/* We can't assure there are no duplicates, so do normal insertions */
for
(
i
=
0
;
i
<=
other
->
mask
;
i
++
,
other_entry
++
)
{
for
(
i
=
0
;
i
<=
other
->
mask
;
i
++
)
{
other_entry
=
&
other
->
table
[
i
];
key
=
other_entry
->
key
;
if
(
key
!=
NULL
&&
key
!=
dummy
)
{
Py_INCREF
(
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