vcpkg/ports/flatbuffers/fix-issue-6036.patch

24 lines
1.0 KiB
Diff
Raw Normal View History

diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h
index c4dc5bc..c090455 100644
--- a/include/flatbuffers/flatbuffers.h
+++ b/include/flatbuffers/flatbuffers.h
@@ -1861,14 +1861,14 @@ class FlatBufferBuilder {
/// @cond FLATBUFFERS_INTERNAL
template<typename T> struct TableKeyComparator {
- TableKeyComparator(vector_downward &buf) : buf_(buf) {}
+ TableKeyComparator(vector_downward &buf) : buf_(&buf) {}
TableKeyComparator(const TableKeyComparator &other) : buf_(other.buf_) {}
bool operator()(const Offset<T> &a, const Offset<T> &b) const {
- auto table_a = reinterpret_cast<T *>(buf_.data_at(a.o));
- auto table_b = reinterpret_cast<T *>(buf_.data_at(b.o));
+ auto table_a = reinterpret_cast<T *>(buf_->data_at(a.o));
+ auto table_b = reinterpret_cast<T *>(buf_->data_at(b.o));
return table_a->KeyCompareLessThan(table_b);
}
- vector_downward &buf_;
+ vector_downward *buf_;
private:
TableKeyComparator &operator=(const TableKeyComparator &other) {