projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
gdb_vecs.h: Avoid self move assign
[deliverable/binutils-gdb.git]
/
gdb
/
gdbsupport
/
gdb_vecs.h
diff --git
a/gdb/gdbsupport/gdb_vecs.h
b/gdb/gdbsupport/gdb_vecs.h
index e87ebe26e993bbc472b9c16d8c7fd5481415f685..e8af624770dbc4a974443e6b0c93e4a6ae58d447 100644
(file)
--- a/
gdb/gdbsupport/gdb_vecs.h
+++ b/
gdb/gdbsupport/gdb_vecs.h
@@
-51,7
+51,8
@@
unordered_remove (std::vector<T> &vec, typename std::vector<T>::iterator it)
gdb_assert (it >= vec.begin () && it < vec.end ());
T removed = std::move (*it);
- *it = std::move (vec.back ());
+ if (it != vec.end () - 1)
+ *it = std::move (vec.back ());
vec.pop_back ();
return removed;
This page took
0.025128 seconds
and
4
git commands to generate.