Skip to content

Does element_offset need to guard against overflow? #60081

@eseidel

Description

@eseidel

static intptr_t element_offset(intptr_t index) {

sizeof(UntaggedObjectPool::Entry) is 8 on arm64

0x7FFFFFFF is the max signed positive integer. So any value 0xFFFFFFF or larger would overflow here.

We happened to hit this in a test case. I'm not sure any dart program in the wild actually has 268M object pool entries. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.needs-infoWe need additional information from the issue author (auto-closed after 14 days if no response)type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions