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

c: use proper type coercion in consume #44

Closed
wants to merge 1 commit into from

Commits on May 12, 2021

  1. c: use proper type coercion in consume

    On 32bit platforms `size_t` is essentially `uint32_t` (or at times
    even meager `uint16_t`). Loading `uint64_t` field value into `size_t` on
    these platforms would truncate the high bits and leave only the low 32
    (16) bits in place. This leads to various interesting errors in
    downstream modules. See:
    
    - nodejs/llhttp#110
    - nodejs/undici#803
    
    This patch makes all field loads go into their respective types.
    Truncation doesn't happen in this case because C coercion rules will
    cast both types to the largest necessary datatype to hold either of
    them.
    indutny committed May 12, 2021
    Configuration menu
    Copy the full SHA
    0ea76ed View commit details
    Browse the repository at this point in the history