Skip to content

bug: range with end larger than start leads to underflow #7337

@dentiny

Description

@dentiny

Describe the bug

Hi team, we have a few range concepts in the codebase (ex, ex), which implicitly requires end offset is no less than start offset, but I don't think we check it.

As a result, we could potentially suffer underflow in certain places

Steps to Reproduce

N/A

Expected Behavior

we check the input requirement at construction and propagate the error / panic as early as possible

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorereleases-note/fixThe PR fixes a bug or has a title that begins with "fix"rustPull requests that update Rust code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions