TypeScript: read vtable entries as uint16 (#8435)

Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
This commit is contained in:
Jacob Bandes-Storch
2025-11-27 02:55:34 -08:00
committed by GitHub
parent 185e41fac4
commit 84f4b83d3e

View File

@@ -192,8 +192,8 @@ export class ByteBuffer {
*/ */
__offset(bb_pos: number, vtable_offset: number): Offset { __offset(bb_pos: number, vtable_offset: number): Offset {
const vtable = bb_pos - this.readInt32(bb_pos); const vtable = bb_pos - this.readInt32(bb_pos);
return vtable_offset < this.readInt16(vtable) return vtable_offset < this.readUint16(vtable)
? this.readInt16(vtable + vtable_offset) ? this.readUint16(vtable + vtable_offset)
: 0; : 0;
} }