Skip to content

Commit

Permalink
fix(ethexe): correctly determine if allocations changed (#4436)
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx authored Jan 13, 2025
1 parent f25a0df commit 92eb9cc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ethexe/runtime/common/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ impl MemoryPagesRegion {
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub struct RegionIdx(u8);

#[derive(Default, Debug, Encode, Decode, PartialEq, Eq, derive_more::Into)]
#[derive(Clone, Default, Debug, Encode, Decode, PartialEq, Eq, derive_more::Into)]
pub struct Allocations {
inner: IntervalsTree<WasmPage>,
#[into(ignore)]
Expand All @@ -998,9 +998,7 @@ impl Allocations {
.flat_map(|i| i.to_iter())
.collect();

if !removed_pages.is_empty()
|| allocations.intervals_amount() != self.inner.intervals_amount()
{
if !removed_pages.is_empty() || allocations.difference(&self.inner).next().is_some() {
self.changed = true;
self.inner = allocations;
}
Expand Down

0 comments on commit 92eb9cc

Please sign in to comment.