mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 22:10:01 +00:00
* [TS]: Fix vtable creation for consecutive required fileds (#7739) * handle feedback * comment the schema * comment change in builder.ts * [TS]: builder, Fix requiredField() Verifty that the field is present in the vtable. * restore monsterdata binary file Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -458,7 +458,8 @@ export class Builder {
|
||||
requiredField(table: Offset, field: number): void {
|
||||
const table_start = this.bb.capacity() - table;
|
||||
const vtable_start = table_start - this.bb.readInt32(table_start);
|
||||
const ok = this.bb.readInt16(vtable_start + field) != 0;
|
||||
const ok = field < this.bb.readInt16(vtable_start) &&
|
||||
this.bb.readInt16(vtable_start + field) != 0;
|
||||
|
||||
// If this fails, the caller will show what field needs to be set.
|
||||
if (!ok) {
|
||||
|
||||
Reference in New Issue
Block a user