Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btf: fix off-by-one in Spec.TypeByID #993

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Commits on Mar 29, 2023

  1. btf: fix off-by-one in Spec.TypeByID

    Spec.lastTypeID was introduced to avoid having to do overflow checks
    in multiple places. However, in combination with firstTypeID it leads
    to confusion. Spec.lastTypeID is actually a valid id, instead of the
    first invalid one. This bit me when refactoring Spec.TypeByID.
    
    Remove Spec.lastTypeID in favour of arithmetic based on firstTypeID
    and len(types).
    
    Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
    lmb committed Mar 29, 2023
    Configuration menu
    Copy the full SHA
    8d7e7ea View commit details
    Browse the repository at this point in the history