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

Fix SegmentReader bugs #134

Merged
merged 2 commits into from
Sep 1, 2023
Merged

Commits on Sep 1, 2023

  1. Use word arithmetic for SegmentReader

    Prior to this change, the start index was treated as a byte index
    rather than a word index.
    Jonah Beckford committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    f7608be View commit details
    Browse the repository at this point in the history
  2. Support signed offsets

    Both Structs and Lists support two's complement "Signed" offsets:
    
    > B (30 bits) = Offset, in words, from the end
    > of the pointer to the start of the struct's
    > data section.  Signed.
    
    > B (30 bits) = Offset, in words, from the end
    > of the pointer to the start of the first
    > element of the list.  Signed.
    
    The prior code only supported positive offsets
    because it used the Java >>> operator, which
    is an unsigned shift operator. The Java >>
    operator is the signed shift operator.
    
    Audited the remaining uses of the shift
    operator; they were correct and they are
    documented as such.
    
    Positive offsets are only guaranteed in a Canonical message.
    Jonah Beckford committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    c5c0fae View commit details
    Browse the repository at this point in the history