Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11562-wasm32-accessor-pair-limit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **perry-runtime**: `accessor_pair.rs`'s `RAW_ADDRESS_LIMIT` (`1 << 48`) is a `u64` instead of a `usize`, so perry-runtime builds for `wasm32-wasip2` again (the constant overflowed a 32-bit `usize`, E0080). No change on 64-bit hosts.
8 changes: 4 additions & 4 deletions crates/perry-runtime/src/object/accessor_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ pub(crate) struct Accessor {

/// Largest code address a raw word can hold: below it no NaN-box tag bit is
/// set, so the word is a Number to the collector.
const RAW_ADDRESS_LIMIT: usize = 1 << 48;
const RAW_ADDRESS_LIMIT: u64 = 1 << 48;

#[inline]
fn raw_word(raw: usize) -> u64 {
debug_assert!(raw < RAW_ADDRESS_LIMIT);
if raw < RAW_ADDRESS_LIMIT {
debug_assert!((raw as u64) < RAW_ADDRESS_LIMIT);
if (raw as u64) < RAW_ADDRESS_LIMIT {
raw as u64
} else {
0
Expand All @@ -74,7 +74,7 @@ fn raw_word(raw: usize) -> u64 {

#[inline]
fn raw_of(word: u64) -> usize {
if (word as usize) < RAW_ADDRESS_LIMIT {
if word < RAW_ADDRESS_LIMIT {
word as usize
} else {
0
Expand Down
Loading