mutation_reader_merger: don't query the kind of moved-from fragment

Call mutation_fragment_kind() on the fragment *before* it's moved as
there are not guarantees for the state of a moved-from object (apart
from that it's in a valid one).

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <c47b1e22877bb9499f1fbb9d513093c29ef1901b.1512635422.git.bdenes@scylladb.com>
This commit is contained in:
Botond Dénes
2017-12-07 10:30:33 +02:00
committed by Avi Kivity
parent 060e5d3354
commit 1ff65f41fd

View File

@@ -204,8 +204,9 @@ future<mutation_reader_merger::mutation_fragment_batch> mutation_reader_merger::
do {
boost::range::pop_heap(_fragment_heap, fragment_heap_compare(*_schema));
auto& n = _fragment_heap.back();
const auto kind = n.fragment.mutation_fragment_kind();
_current.emplace_back(std::move(n.fragment));
_next.emplace_back(n.reader, n.fragment.mutation_fragment_kind());
_next.emplace_back(n.reader, kind);
_fragment_heap.pop_back();
}
while (!_fragment_heap.empty() && equal(_current.back().position(), _fragment_heap.front().fragment.position()));