Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
63711818
Commit
63711818
authored
Sep 01, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cypclass dict item deletion invalidating active iterators
parent
84e0507e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
Cython/Includes/libcythonplus/dict.pxd
Cython/Includes/libcythonplus/dict.pxd
+11
-7
No files found.
Cython/Includes/libcythonplus/dict.pxd
View file @
63711818
...
@@ -286,13 +286,17 @@ cdef cypclass cypdict[K, V]:
...
@@ -286,13 +286,17 @@ cdef cypclass cypdict[K, V]:
it
=
self
.
_indices
.
find
(
key
)
it
=
self
.
_indices
.
find
(
key
)
end
=
self
.
_indices
.
end
()
end
=
self
.
_indices
.
end
()
if
it
!=
end
:
if
it
!=
end
:
index
=
dereference
(
it
).
second
if
self
.
_active_iterators
==
0
:
Cy_DECREF
(
self
.
_items
[
index
].
first
)
index
=
dereference
(
it
).
second
Cy_DECREF
(
self
.
_items
[
index
].
second
)
Cy_DECREF
(
self
.
_items
[
index
].
first
)
self
.
_indices
.
erase
(
it
)
Cy_DECREF
(
self
.
_items
[
index
].
second
)
if
index
<
self
.
_items
.
size
()
-
1
:
self
.
_indices
.
erase
(
it
)
self
.
_items
[
index
]
=
self
.
_items
[
self
.
_indices
.
size
()
-
1
]
if
index
<
self
.
_items
.
size
()
-
1
:
self
.
_items
.
pop_back
()
self
.
_items
[
index
]
=
self
.
_items
[
self
.
_indices
.
size
()
-
1
]
self
.
_items
.
pop_back
()
else
:
with
gil
:
raise
RuntimeError
(
"Modifying a dictionary with active iterators"
)
else
:
else
:
with
gil
:
with
gil
:
raise
KeyError
(
"Deleting nonexistent item"
)
raise
KeyError
(
"Deleting nonexistent item"
)
...
...
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