read vtable size through ReadScalar() (#5636)
This commit is contained in:
parent
136d75fa65
commit
bcf1bd5c9e
|
@ -1364,7 +1364,7 @@ class FlatBufferBuilder {
|
||||||
it += sizeof(uoffset_t)) {
|
it += sizeof(uoffset_t)) {
|
||||||
auto vt_offset_ptr = reinterpret_cast<uoffset_t *>(it);
|
auto vt_offset_ptr = reinterpret_cast<uoffset_t *>(it);
|
||||||
auto vt2 = reinterpret_cast<voffset_t *>(buf_.data_at(*vt_offset_ptr));
|
auto vt2 = reinterpret_cast<voffset_t *>(buf_.data_at(*vt_offset_ptr));
|
||||||
auto vt2_size = *vt2;
|
auto vt2_size = ReadScalar<voffset_t>(vt2);
|
||||||
if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue;
|
if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue;
|
||||||
vt_use = *vt_offset_ptr;
|
vt_use = *vt_offset_ptr;
|
||||||
buf_.pop(GetSize() - vtableoffsetloc);
|
buf_.pop(GetSize() - vtableoffsetloc);
|
||||||
|
|
Loading…
Reference in New Issue