Skip to content

Conversation

@tcharding
Copy link
Member

We cast u32 to usize in a bunch of places, this will cause strange behaviour because of truncation on 16 bit architectures.

Add a compile time check to explicitly not support 16 bit architectures.

We cast `u32` to `usize` in a bunch of places, this will cause
strange behaviour because of truncation on 16 bit architectures.

Add a compile time check to explicitly not support 16 bit architectures.
@tcharding tcharding force-pushed the 07-01-pointer-width-check branch from 995f342 to d02c313 Compare July 1, 2022 01:48
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK d02c313

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d02c313

@sanket1729 sanket1729 merged commit d524c6d into rust-bitcoin:master Jul 8, 2022
@tcharding tcharding deleted the 07-01-pointer-width-check branch July 12, 2022 02:23
heap-coder added a commit to heap-coder/rust-miniscript that referenced this pull request Sep 27, 2025
…bit architectures

d02c31309985cbae8af4ea0f61272c036737a639 Explicitly do not support 16 bit architectures (Tobin C. Harding)

Pull request description:

  We cast `u32` to `usize` in a bunch of places, this will cause strange behaviour because of truncation on 16 bit architectures.

  Add a compile time check to explicitly not support 16 bit architectures.

ACKs for top commit:
  apoelstra:
    ACK d02c31309985cbae8af4ea0f61272c036737a639

Tree-SHA512: 11466e173913c5337f9a4ea03a4df5ee6be809ca32987494881d470c87a41f9cca77dde7ed68289896cce5cc875b89ab34a164ea2f4dc41b9fbe6e0ab9a62e71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants