Skip to content

swift getCheckedRoot(fileId: ) will assert on buffer < (8?) bytes rather than throw. [swift, swiftc 6.0, OSX, 24.3.25] #8408

@peeeeter

Description

@peeeeter
let dutData : [UInt8] = [1,2,3]
var buff  = ByteBuffer(bytes: dutData)
let foo: Foo = try getCheckedRoot(byteBuffer: &buff, fileId: "ABCD")
  FlatBuffers/ByteBuffer.swift:470: Assertion failed: Reading out of bounds is illegal

With try getCheckedRoot(byteBuffer: &buff), throws an out of bounds error (which seems correct), but with "fileid", you get an unrecoverable assert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions